Article View: alt.lang.basic
Article #588Re: Pascal -> Visual Basic 4
From: ~The Rat
Date: Tue, 11 Nov 1997 00:00
Date: Tue, 11 Nov 1997 00:00
32 lines
2369 bytes
2369 bytes
jdm wrote in message ...
>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
Not. The Ord function looks a lot like the VB ASC function. Return a
integer for the character value (i.e. Ord('A') = 65; == Asc("A") = 65). You
may have to handle a special case when the value of s[i] is a non-character,
but I assume since you are ORD'ing the array that it is a character. As far
as the INC, I'm assuming that you are Incrementing the value of I based on
'some number' + (some number * some number). In VB, maybe something like
I = I + ( ASC( s(i) ) + (i * i) ) 'gee with all of those parenthesis,
kinda looks like Lisp..no I won't translate it to Lisp on principle alone
But, I could be wrong...didn't test it. Of course you might make a function
Inc that takes a variable in and returns inc = inc + vaLin....
Best of luck.
~the Rat
Technical Details
Message-ID:
<64b15k$pst@bolivia.earthlink.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<63qonl$r0p@bgtnsc03.worldnet.att.net> <CDEE44D8B50A9A09.E53701FC15417D78.AC45F1A94053FDAB@library-proxy.airnews.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: 10ab99,d4e4032bb8f921fa X-Google-Attributes: gid10ab99,public X-Google-Thread: 110e3b,d4e4032bb8f921fa X-Google-Attributes: gid110e3b,public X-Google-Thread: 111659,d4e4032bb8f921fa X-Google-Attributes: gid111659,public X-Google-Thread: 10c950,d4e4032bb8f921fa X-Google-Attributes: gid10c950,public X-Google-Thread: 108ebd,d4e4032bb8f921fa X-Google-Attributes: gid108ebd,public From: "~The Rat" <ratbert@earthlink.net> Subject: Re: Pascal -> Visual Basic 4 Date: 1997/11/11 Message-ID: <64b15k$pst@bolivia.earthlink.net> X-Deja-AN: 288760541 References: <63qonl$r0p@bgtnsc03.worldnet.att.net> <CDEE44D8B50A9A09.E53701FC15417D78.AC45F1A94053FDAB@library-proxy.airnews.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: Pair of Ducks 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