🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

4 total messages Started by John Rickard Wed, 05 Nov 1997 00:00
Pascal -> Visual Basic 4
#589
Author: John Rickard
Date: Wed, 05 Nov 1997 00:00
24 lines
1643 bytes
i am coverting a pascal source i did a while back to vb4 so i can use
it in my program.
i have totally coverted everything except 1 thing.
below is the pascal part i am having trouble comvertin to vb4.

 inc(l, Ord(s[i]) + (i * i))

and help is appreciated.

l,i are longint and integer
s is string
it is piece from a reg code gen program for my shareware...
i could just start from scratch writing a reg gen for win but i
wanted to try and learn something by converting it :) please help.

PLEASE if possible reply to me and the newsgroup as i do not have
alot of time to read every group all the time.

-- 
--
Remove .DONTSPAMME from my
email address to send me REAL email.
--
Re: Pascal -> Visual Basic 4
#590
Author: jdm
Date: Wed, 05 Nov 1997 00:00
14 lines
1612 bytes
John Rickard <saskan@worldnet.att.net.DONTSPAMME> wrote in article
<63qonl$r0p@bgtnsc03.worldnet.att.net>...
> i am coverting a pascal source i did a while back to vb4 so i can use
> it in my program.
> i have totally coverted everything except 1 thing.
> below is the pascal part i am having trouble comvertin to vb4.
> 
>  inc(l, Ord(s[i]) + (i * i))

Visual Basic has neither an Inc() function or an Ord() function.  Ergo,
you will have to write your own.  

jdm
Re: Pascal -> Visual Basic 4
#591
Author: Asbj�rn
Date: Thu, 06 Nov 1997 00:00
19 lines
1380 bytes
John Rickard wrote:
> 
> i am coverting a pascal source i did a while back to vb4 so i can use
> it in my program.
> i have totally coverted everything except 1 thing.
> below is the pascal part i am having trouble comvertin to vb4.
> 
>  inc(l, Ord(s[i]) + (i * i))

think it should be

L = L + (asc(mid$(s, i, 1)) + (i * i)
 
-- 
- Asbj�rn

lordcrc@hotmail.com
http://home.sol.no/~bheid/
Re: Pascal -> Visual Basic 4
#592
Author: Marcel Smolenaars
Date: Thu, 06 Nov 1997 00:00
40 lines
2196 bytes
John Rickard wrote:
> 
> i am coverting a pascal source i did a while back to vb4 so i can use
> it in my program.
> i have totally coverted everything except 1 thing.
> below is the pascal part i am having trouble comvertin to vb4.
> 
>  inc(l, Ord(s[i]) + (i * i))
> 
> and help is appreciated.
> 
> l,i are longint and integer
> s is string
> it is piece from a reg code gen program for my shareware...
> i could just start from scratch writing a reg gen for win but i
> wanted to try and learn something by converting it :) please help.
> 
> PLEASE if possible reply to me and the newsgroup as i do not have
> alot of time to read every group all the time.
> 
> --
> --
> Remove .DONTSPAMME from my
> email address to send me REAL email.
> --

What about :

	l = l + asc(mid$(s,i,1) + i*i

the function mid$ returns a char (actually a string of the length 1 )
from the string sstarting at char number i and with a length of 1
the function asc returns the ascii value of a char

It's by far not as efficient as the pascal way , but it'll work.
(ineffeicient since a string will be returned by mid$() that has to be
interpreted by asc() )

Marcel Smolenaars
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads