Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Randomize between different texts
#3
this might be closer to what you are trying to do.

Function randomize_or_choose_text_
Trigger Sz     Help - how to add the trigger to the macro
Code:
Copy      Help
ARRAY(str) messageText="Random[]a[]b[]c[]d[]e[]f[]g[]h[]i[]j[]k[]l[]m[]n[]o[]p[]q[]r[]s[]t[]u[]v[]w[]x[]y[]z"
;;the above array is just for this demo. Change to whatever text you would like. each line of
;;text needs to have [] after it except last item
;; example ARRAY(str) messageText="Random[]Hi[]Hello[]Bye[]Goodbye[]Okay[]OK"
str result=messageText;;convert array to a string so we can display it in the ListDialog
int i=ListDialog(result);
sel i
,case 0
,ret
,case 1;;Random selected
,int ii=RandomInt(2 27);;set number range from 2-27 since 0 means cancel button clicked and 1 is for random
,out messageText[ii-1];;send to qm output window random item
,case else;; any other selected item
,out messageText[i-1];;send to qm output window selected item


Messages In This Thread
Randomize between different texts - by Leeroll - 02-03-2018, 05:48 PM
RE: Randomize between different texts - by BJ - 02-05-2018, 09:06 PM
RE: Randomize between different texts - by Kevin - 02-24-2018, 03:00 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)