Computer Science Canada

Hex to Dec and Bin to Dec with functions

Author:  joe333 [ Tue Apr 13, 2004 2:55 pm ]
Post subject:  Hex to Dec and Bin to Dec with functions

I am new at this but i am learning lol, I have to make these two SEPARTE programs, I have bin to dec done but i don't know how to turn it into a function. Any help? I searched but the one that I found I didn''t understand. I am also not allowed to use the "strint" way

Author:  joe333 [ Tue Apr 13, 2004 3:07 pm ]
Post subject: 

I am now also stuck with the hex to dec. lol

Author:  Raugrist [ Tue Apr 13, 2004 3:11 pm ]
Post subject: 

Use intstr() or strint(). I haven't used those for base conversion in a while so my memory of them is fuzzy, and I'm on Linux right now so I can't check. But if you type intstr and press F9 it should show you how to use it to convert numbers while specifying a base. Type strint and press F9 as well just to make sure.

Author:  joe333 [ Tue Apr 13, 2004 3:22 pm ]
Post subject: 

I put in my post above that I am not allowed to use those.

Author:  Raugrist [ Tue Apr 13, 2004 3:24 pm ]
Post subject: 

Oh, sorry.

Author:  Delos [ Tue Apr 13, 2004 4:23 pm ]
Post subject: 

Quote:

Look here (I used the "Search" button...amazing...)

http://www.compsci.ca/v2/viewtopic.php?t=3245


That is a post of mine from another thread...in this forum.

Anyhow, without using strint etc you'll need to develop your own character detection using index.


index (stringToBeAnalysed, searchStringPattern"


There's a hundred examples around the site.


: