Thread: VB Question
View Single Post
Old 03-15-2003, 11:59 AM   #30
Night Stalker
Lord Ao
 

Join Date: June 24, 2002
Location: Nevernever Land
Age: 51
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