Posts: 229
Threads: 22
Joined: Sep 2007
How can i replace this text, i know i have to use an int dont know how to add 1
bob10
then out to qm output box bob11
so then i can replace bob10 to bob11 in the edit box.
Posts: 331
Threads: 60
Joined: May 2006
str BB="Bob"
int i
rep 10
,i+1
,out "%s%i" BB i
OR
str tmp BB="Bob"
int i
i=10
tmp.formata("%s%i" BB i)
out tmp
OR
int i
i=10
str tmp.formata("Bob%i" i)
out tmp
Posts: 229
Threads: 22
Joined: Sep 2007
thanks for the reply, i think i asked the question wrong way.
what i want to do, is if in my edit box i have bob10 i want to change it to bob11 and also if it reads out bob110 to change it to bob111
so what im asking for it to count up in ones,
bob01
bob02
bob03
bob04
bob05
bob06
bob07
bob08
bob09
bob10
bob11
bob12
bob13
etc
bob19
bob20
bob21
etc
bob99
bob100
bob101
of course i dont want all them to run at once. so depending on the number thats there when i start run it it will change it to the next number up. if its possible,
what im gona do is get the text using getwintext and grabing the info through the controls,
then setwintext with the new number added to it
Posts: 331
Threads: 60
Joined: May 2006
There maybe a better way of doing it but this works.
int i
str tmp b s subject="Bob10"
findrx(subject "\d+" 0 0 s);;gets # from string
findrx(subject "[^0-9]+" 0 0 b);;gets word from string
i=val(s);i+1 ;; adds one
tmp.formata("%s%i" b i)
out tmp
Posts: 229
Threads: 22
Joined: Sep 2007
Posts: 229
Threads: 22
Joined: Sep 2007
i got to use the code that you kindly made, but im now running into this problem
bob010
doesnt change to bob011
is there anyway i can change the code, so it would work for that also,
Posts: 229
Threads: 22
Joined: Sep 2007
John Wrote:str BB="Bob"
int i
rep 10
,i+1
,out "%s%i" BB i
OR
str tmp BB="Bob"
int i
i=10
tmp.formata("%s%i" BB i)
out tmp
OR
int i
i=10
str tmp.formata("Bob%i" i)
out tmp
is there a quick way to populate a combobox, with the out results?