Jump to content
Macro Express Forums

Need Help With String Operation


Recommended Posts

I have a combo box which contains the resolution of a photo, for example "1024x768"


So far I figured out how to get this into a string variable:

Variable Get Control Text: %C1% to %T1%


How do I split and convert this string into two integer variables so that

%N1%=1024 and %N2%=768?


I think I cannot use the command

Variable Modify String / Copy Part of Text

because the Starting Position has to be specified.


Is there something analog to the strchr() or strstr() function in C?

I.e. a macro that gives me the offset of a character (or string) in a string.


It should be obvious that the size of photos varies so that the position of the x is unknown in advance.

Link to comment
Share on other sites

Variable Set String %T1% "1024x768"
Variable Set Integer %N99% from Position of Text in Variable %T1%
Variable Modify Integer: Inc (%N99%)
Variable Modify String: Copy Part of %T1% to %T2%
Variable Modify String: Convert %T1% to integer %N1%
Variable Modify String: Convert %T2% to integer %N2%
Pause: Complex


<TVAR2:01:01:1024x768><IVAR2:99:13:1:x><NMVAR:08:99:0:0000001:0:0000000><TMVAR2:10:02:01:N99:010:><TMVAR2:05:01:01:000:000:><TMVAR2:05:02:02:000:000:><PAUSE2:000531,000636dimensions are : %N1%  x  %N2%T>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...