03-14-2003, 01:15 AM | #21 |
Jack Burton
Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
|
Ok, I think I see a mod() command being used alot... but converting back to decimal could pose a problem...
Maybe I should work on Binary - Octal - Decimal and back first; atleast that won`t have me dealing with letters... |
03-15-2003, 02:25 AM | #22 |
Lord Ao
Join Date: June 24, 2002
Location: Nevernever Land
Age: 49
Posts: 2,002
|
Actually going from hex to dec is really easy -> treat it as a string and process each char separately in a loop. Handle A-F in a case statement. This by any chance wouldn't be homework? Anyway the prototype would be:
function HexToDec(strHexNum as string) as long
__________________
[url]\"http://www.duryea.org/pinky/gurkin.wav\" target=\"_blank\">AYPWIP?</a> .... <img border=\"0\" alt=\"[1ponder]\" title=\"\" src=\"graemlins/1ponder.gif\" /> <br />\"I think so Brain, but isn\'t a cucumber that small called a gherkin?\"<br /><br />Shut UP! Pinky! |
03-15-2003, 05:25 AM | #23 |
Lord Ao
Join Date: September 11, 2001
Location: Sydney, Australia
Posts: 2,061
|
[img]graemlins/wow.gif[/img] Whoa! All this stuff looks so complicated!
There I was thinking this would a topic about VB's (as in the beer) |
03-15-2003, 06:34 AM | #24 |
Dracolisk
Join Date: January 5, 2002
Location: Guantanamo Bay, Cuba
Age: 38
Posts: 6,043
|
*tsk tsk tsk* All this visual basic stuff is just .. hard... it's like another language... err it is.... but honestly... I'm a sever hater of VB myself, and I don't mind voicing my opinoin on being Pro-Java... So its more complicated, yeah well at least I can freaking understand what i'm puttin in [img]tongue.gif[/img] I think my favorite code to go with, though, it HTML... [img]tongue.gif[/img]
oh right back to my opinion: C will live forver! yarr! Even if it goes under the name Java and C#... there... [img]tongue.gif[/img] Now with that visual basic question... Night stalker just gave you the answer so theres no pont in my working on it [img]tongue.gif[/img] aaaand im so tired i'm just gonna go to sleep now...
__________________
[img]\"http://membres.lycos.fr/th8or/ZeroSigForIronworks.gif\" alt=\" - \" /> o.o; |
03-15-2003, 07:17 AM | #25 |
Harper
Join Date: October 2, 2001
Location: Aberdeen, Scotland
Age: 42
Posts: 4,774
|
Regarding the VB stuff we were talking about last night (OK, it was morning for you, who cares), theres a minor bug in the code I gave you.
This is why I use 2d arrays for crap like this, but I guess were stuck with a 1d now. Anyway, 8 MOD 8 is 0. So "if index mod 8 < 6" will return true when dealing with column 8, which screws up the whole function. Ill leave the corrections up to you. And LEARN C. Its faster, more efficient, more powerful, and looks better on your CV.
__________________
[img]\"http://www.sighost.us/members/Zvijer/andrewas.gif\" alt=\" - \" /> |
03-15-2003, 07:29 AM | #26 | |
Lord Ao
Join Date: March 3, 2001
Location: London, England
Age: 30
Posts: 2,021
|
Quote:
I,ve learnt C but I'm having trouble with the V for my CV. Can you help....can you? Please, I was doing so well up till then.
__________________
[img]\"http://img.ranchoweb.com/images/ladyzekke/england1.gif\" alt=\" - \" /><br />One Love, Peace. [img]\"http://img.ranchoweb.com/images/ladyzekke/pissr.gif\" alt=\" - \" /> [img]\"http://img.ranchoweb.com/images/ladyzekke/piss.gif\" alt=\" - \" /> |
|
03-15-2003, 08:53 AM | #27 | |
Jack Burton
Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
|
Quote:
|
|
03-15-2003, 08:56 AM | #28 | |
Jack Burton
Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
|
Quote:
I`m not quite sure I understand how to process each character separately... hints, maybe ?? [img]smile.gif[/img] And is a Function the same thing as a Sub ?? Is one considered more correct over the other ?? And while i`m in a question mood, what is the difference between telling it to "End" and telling it to "Unload Me" ?? [ 03-15-2003, 09:00 AM: Message edited by: LennonCook ] |
|
03-15-2003, 11:09 AM | #29 |
Harper
Join Date: October 2, 2001
Location: Aberdeen, Scotland
Age: 42
Posts: 4,774
|
1) Think why If index >3 didnt work earlier.
2) Learn C. You can handle a string as an array, and FOR through it. Sub and Function are similar, functions return a value, Subs dont. So you could set a = function(b) but not a = sub(b) I have no idea on the end thing. I guess that end is equivalent to a C++ destructor, which cleans up the object then deletes it so you dont have any dead ends, whereas unload me would be equivalent to the free() function. End sounds safer. But Im guessing here.
__________________
[img]\"http://www.sighost.us/members/Zvijer/andrewas.gif\" alt=\" - \" /> |
03-15-2003, 11:59 AM | #30 |
Lord Ao
Join Date: June 24, 2002
Location: Nevernever Land
Age: 49
Posts: 2,002
|
End is a forceful shutdown to the whole program, ungracefully.
Unload object is the class destructor. A function returns a value, a sub does not. Useing x=sub() will cause an error. Yes strings are just null terminated charactor (byte) arrays. I forget if VB will let you index a string directly or not. If not you can use the mid funtcion in the for loop. code:function HexToDec( HexNum as string) as long[/QUOTE]There's a really big hint ... good luck.
__________________
[url]\"http://www.duryea.org/pinky/gurkin.wav\" target=\"_blank\">AYPWIP?</a> .... <img border=\"0\" alt=\"[1ponder]\" title=\"\" src=\"graemlins/1ponder.gif\" /> <br />\"I think so Brain, but isn\'t a cucumber that small called a gherkin?\"<br /><br />Shut UP! Pinky! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Another Video Card Question becomes Antivirus Question!!! | Bahamut | General Conversation Archives (11/2000 - 01/2005) | 19 | 12-27-2003 11:40 PM |
One BIZZZARE question and one normal everyday question | Sythe | Baldurs Gate II: Shadows of Amn & Throne of Bhaal | 3 | 09-10-2002 02:44 AM |
Early ch6 question - poss spoiler info in question... | Fljotsdale | Baldurs Gate II Archives | 5 | 03-18-2001 12:33 AM |
Dragon spire crystal question + question about Giant killing for the warriorguild | Malakez | Wizards & Warriors Forum | 4 | 02-20-2001 03:52 PM |
spell lvl question, buying spells question, and role ascension question | Paupa | Wizards & Warriors Forum | 1 | 12-31-2000 04:59 PM |