duebel13 Posted April 14, 2005 Report Share Posted April 14, 2005 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. Quote Link to comment Share on other sites More sharing options...
floyd Posted April 14, 2005 Report Share Posted April 14, 2005 Get the position of a character, or string, within a string by using the Variable Set Integer %N1% from Position of Text in Variable %T1% command. Quote Link to comment Share on other sites More sharing options...
Nicolas Posted April 17, 2005 Report Share Posted April 17, 2005 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.