Visit the Ironworks Gaming Website Email the Webmaster Graphics Library Rules and Regulations Help Support Ironworks Forum with a Donation to Keep us Online - We rely totally on Donations from members Donation goal Meter

Ironworks Gaming Radio

Ironworks Gaming Forum

Go Back   Ironworks Gaming Forum > Ironworks Gaming Forums > General Discussion > General Conversation Archives (11/2000 - 01/2005)
FAQ Calendar Arcade Today's Posts Search

 
 
Thread Tools Search this Thread
Old 03-14-2003, 01:15 AM   #21
LennonCook
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...
LennonCook is offline  
Old 03-15-2003, 02:25 AM   #22
Night Stalker
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!
Night Stalker is offline  
Old 03-15-2003, 05:25 AM   #23
GokuZool
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)
GokuZool is offline  
Old 03-15-2003, 06:34 AM   #24
/)eathKiller
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;
/)eathKiller is offline  
Old 03-15-2003, 07:17 AM   #25
andrewas
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=\" - \" />
andrewas is offline  
Old 03-15-2003, 07:29 AM   #26
Charlie
Lord Ao
 

Join Date: March 3, 2001
Location: London, England
Age: 30
Posts: 2,021
Quote:
Originally posted by andrewas:
Regarding the VB stuff we were talking about last night
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.
Well I'm super efficient with everything you've taught me so far. I've got 8 Mods for 2d which = 1d index< mod head explosion.
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=\" - \" />
Charlie is offline  
Old 03-15-2003, 08:53 AM   #27
LennonCook
Jack Burton
 

Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
Quote:
Originally posted by andrewas:
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.

What about "If index mod 8<6 And Index <> 8" ??
LennonCook is offline  
Old 03-15-2003, 08:56 AM   #28
LennonCook
Jack Burton
 

Join Date: November 10, 2001
Location: Bathurst & Orange, in constant flux
Age: 37
Posts: 5,452
Quote:
Originally posted by Night Stalker:
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
No, it isn`t homework... just a personal excercise... along with Connect Four, Guess the Number, and learning some other, more powerful, language... maybe German ?? Seemed to work for Hitler...

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 ]
LennonCook is offline  
Old 03-15-2003, 11:09 AM   #29
andrewas
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=\" - \" />
andrewas is offline  
Old 03-15-2003, 11:59 AM   #30
Night Stalker
Lord Ao
 

Join Date: June 24, 2002
Location: Nevernever Land
Age: 49
Posts: 2,002
Question Mark

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
dim strDigit as string
dim lngTempRslt as long
dim i as integer

for i = 1 to len(HexNum)
strDigit = Mid(i, HexNum, 1) '<:-- check the prototype for mid

select case strDigit
case "a"
lngTempRslt = (10 * 10^(i - 1)) + lngTempRslt
.
.
.
case else
lngTempRslt = CLong(strDigit) * 10^(i - 1) + lngTempRslt
end select
next

end function
[/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!
Night Stalker is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

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


All times are GMT -4. The time now is 12:11 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved