Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to set the size of a variable?
#1
This seems like a fairly easy question, however, I was unable to find anything on the forum or help.

I have set up an array and one of the variables needs to be forced to uppercase and limited to a max of 11 characters.The code I have so far is below:

ARRAY(str) sa=(e4sn)
int i
for i 0 len(e4sn)
//
,Htm c=htm("INPUT" "serialNumber" "" win("test page") 0 8 0x221)
,c.SetText(sa[i].ucase);wait 0 I

Thank you!
Eric Gibson
#2
wouldnt this work for you?


Macro
Code:
Copy      Help
_s="123456789abc"
_s.left(_s 11)
out _s
An old blog on QM coding and automation.

The Macro Hook
#3
Macro
Code:
Copy      Help
str e4sn=
;012345
;0123456789abcdef

ARRAY(str) sa=e4sn
int i
for i 0 sa.len
,;Htm c=htm("INPUT" "serialNumber" "" win("test page") 0 8 0x221)
,
,str& r=sa[i] ;;makes easier to use sa[i]
,
,r.fix(11 2)
,;or
,;r.left(r 11)
,
,r.ucase
,out r
,
,;c.SetText(r);wait 0 I
#4
Thank you everyone. That was exactly what I was looking for! Eric


Forum Jump:


Users browsing this thread: 1 Guest(s)