Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


conversion question
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Oct 17, 2007 4:11 pm    Post subject: conversion question Reply with quote

I'm using REALbasic to make a program for my school, because it compiles cross-platform and my school uses macs(i know macs Rolling Eyes ) and I need to convert a string to an integer and an integer to a string. I know in delphi its

Code:

StrToInt(bla)
IntToStr(bla)


But this is vb, well almost vb, anyway what function do I use to to convert string to an integer and vice versa?

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Oct 17, 2007 5:34 pm    Post subject: Reply with quote

in C#.NET:

Code:
Convert.ToString(1)
Convert.ToInt32("string") Or Convert.ToSingle("string")


in C++.NET:

Code:
Convert::ToString(1)
Convert::ToInt32("string") or Convert::ToSingle("string")


Int32 = Integer
ToSingle = Float

ehhh

Edit:

its the First One ( Convert.ToString() Convert.ToSingle() )

same As C#

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Oct 17, 2007 5:52 pm    Post subject: Reply with quote

Convert don't work in REALbasic =(
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Oct 17, 2007 6:06 pm    Post subject: Reply with quote

Not sure if REALbasic uses the same as VB6 but in VB6 its:

CInt(Other Val) // Convert To Integer
CStr(Other Val) // Convert To String

Edit:: Oh and theres nothing wrong with a Mac Razz
Back to top
View user's profile Send private message Visit poster's website
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Oct 17, 2007 6:20 pm    Post subject: Reply with quote

SO like...

Code:

bla = CInt(EditField1.Text)
EditField1.Text = CStr(bla)


?

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Oct 17, 2007 6:21 pm    Post subject: Reply with quote

Yea. What are you converting anyway? You might not even need to use them.
Back to top
View user's profile Send private message Visit poster's website
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Oct 17, 2007 6:34 pm    Post subject: Reply with quote

oh, I'm making a GPA/Overall calc. I'm working on the overall. I am making it specifically for my comp teacher. There are 30 exercises so I should probably put 30 grade integers, but so far I have 8. Basically I need to store the percent he puts in each editbox(EditField) into each integer variable. So string to integer there. Then I have to switch the average percent, so like, 90-100 = A, 80-89 = B, etc. So integer to string there.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Wed Oct 17, 2007 8:26 pm    Post subject: Reply with quote

Does your teacher not have a spreadsheet program?

I remember long ago when I was using VB6 I never knew of the concept of casting. Try putting the string directly into the integer variable, it may be automatically casted.

For converting percentages to marks though, that is not a integer to string casting, but rather a selection.

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Oct 17, 2007 8:32 pm    Post subject: Reply with quote

As long as the string is a numeric value only, it can be casted to other datatypes automatically. But if it contains other things; symbols, letters, etc., you need to alter the string before attempting to cast it.
Back to top
View user's profile Send private message Visit poster's website
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Oct 17, 2007 8:55 pm    Post subject: Reply with quote

Well, he keeps our grades in excel worksheet. But he has to do all the calculations and crap manually. And theres lots of stuf in there.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Wed Oct 17, 2007 9:04 pm    Post subject: Reply with quote

Excel could do the same calculations your program will need to do with much less programming involved and greater portability.
_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Thu Oct 18, 2007 3:53 am    Post subject: Reply with quote

if this is true, your teacher should go work in the lunch line

as he is retarded

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu Oct 18, 2007 3:15 pm    Post subject: Reply with quote

Well, I actually don't know how he does the grades. I am not familiar with excel and we have to use it to keep a log on where we are in exercises but I did not that something like excel did those kind of calculations.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Oct 18, 2007 4:37 pm    Post subject: Reply with quote

Excel is great for things like that. It's very easy to quickly calculate a bunch of things like that (grades for instance). Once you type the formula, all you have to do is drag it by it's little selection handle to wherever else you want or need the same formula and it will automatically update itself for every space it's in.
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Thu Oct 18, 2007 5:03 pm    Post subject: Reply with quote

DeltaFlyer wrote:
Excel could do the same calculations your program will need to do with much less programming involved and greater portability.


lol
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites