🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.basic
Article #592

Re: Pascal -> Visual Basic 4

#592
From: 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
Technical Details
Message-ID: <3461E7DA.4DBA@sci.kun.nl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <63qonl$r0p@bgtnsc03.worldnet.att.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10261c,d4e4032bb8f921fa
X-Google-Attributes: gid10261c,public
X-Google-Thread: 10c950,d4e4032bb8f921fa
X-Google-Attributes: gid10c950,public
X-Google-Thread: 110e3b,d4e4032bb8f921fa
X-Google-Attributes: gid110e3b,public
X-Google-Thread: 111659,d4e4032bb8f921fa
X-Google-Attributes: gid111659,public
X-Google-Thread: 10ab99,d4e4032bb8f921fa
X-Google-Attributes: gid10ab99,public
X-Google-Thread: 108ebd,d4e4032bb8f921fa
X-Google-Attributes: gid108ebd,public
From: Marcel Smolenaars <smolenaa@sci.kun.nl>
Subject: Re: Pascal -> Visual Basic 4
Date: 1997/11/06
Message-ID: <3461E7DA.4DBA@sci.kun.nl>
X-Deja-AN: 287442966
References: <63qonl$r0p@bgtnsc03.worldnet.att.net>
To: John Rickard <saskan@worldnet.att.net.DONTSPAMME>
Organization: University of Nijmegen
Newsgroups: alt.lang.basic,borland.public.turbopascal,comp.lang.basic.visual.misc,comp.lang.pascal.ansi-iso,comp.lang.pascal.borland,comp.lang.pascal.misc