Jump to content
  • 0

Explode into an Integer not a String


Question

Posted

im trying to make the Explode function produce an integer rather then a string EG .@i vs .@i$, and i seem to be having a brain fart, i know ive done this before in a script a while back ideas?

2 answers to this question

Recommended Posts

Posted

Maybe make a loop to convert the string to int with atoi command

explode( .@tmp_string$, "1,2,3,4", "," );
.@size = getarraysize( .@tmp_string$ );
for ( .@i = 0; .@i < .@size; .@i++ )
	.@tmp_int[.@i] = atoi( .@tmp_string$[.@i] );

(or use bitwise operator)

Join the conversation

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

Guest
Answer this question...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...