Patraca0423 Posted May 8, 2017 Report Posted May 8, 2017 regards how can i declare a string variable on sysmac? can you bring me an example? ex. var _a = type array[0..2] of string[20] how can i put this string "hello world" on var_a[x]? var_a[x]:="hello world" that is correct? thanks
IO_Rack Posted May 9, 2017 Report Posted May 9, 2017 Name Data Type Initial Value var_a ARRAY[0..2] OF STRING[20] ['hello world 1', 'hello world 2', 'hello world 3'] If you input STRING[20][3] in the Data Type field it will convert it automatically to look like the above. You don't have to populate the Initial Value field. You can write to it at runtime.
Patraca0423 Posted May 9, 2017 Author Report Posted May 9, 2017 thanks io_rack so can i to put this in my code? ex. Name Data Type Initial Value var_a STRING[20][3] = 4 strings of 20 right? or =( STRING[20][1],STRING[20][2],STRING[20][3]) var_a[0]:='hello' //this is correct? the value asigned to my first string of 20 its equal to 'hello'? var_a[1]:='world' //var_a[1] contains the string 'world'? regardas
IO_Rack Posted May 10, 2017 Report Posted May 10, 2017 Yes, I believe that is correct. Have you tried it in the simulator?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now