Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: data type problem:how to convert String to int?  (Read 2427 times)

0 Members and 1 Guest are viewing this topic.

yaobifeng

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
data type problem:how to convert String to int?
« on: July 11, 2008, 09:52:59 AM »

i define a String variable:
var s=new String(10);
test(s);//here call a dll function test(string),this function is not written by me,so the parameter s is String type,after call it, s="10";
for(var i=0;i<s;i=i+1)
{
do something..........
}

but when i run the programe,the for loop wasn't be execute.
how to convert the variable s to int ?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: data type problem:how to convert String to int?
« Reply #1 on: July 11, 2008, 09:56:44 AM »

var IntVar = ToInt("10");
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

yaobifeng

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
Re: data type problem:how to convert String to int?
« Reply #2 on: July 11, 2008, 10:04:13 AM »

thanks very very much ::beer
Logged
 

Page created in 0.104 seconds with 20 queries.