Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Programmers do it bit by bit.


devel / comp.os.cpm / Filling MBASIC strings from ML.

SubjectAuthor
* Filling MBASIC strings from ML.Thom Cherryhomes
`* Re: Filling MBASIC strings from ML.Martin
 `* Re: Filling MBASIC strings from ML.Martin
  `- Re: Filling MBASIC strings from ML.Tom Lake

1
Filling MBASIC strings from ML.

<3d8d0de6-9e95-4a8c-9aab-07f5e593563cn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=3026&group=comp.os.cpm#3026

 copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:4ea8:: with SMTP id ed8mr62816qvb.52.1641999416779;
Wed, 12 Jan 2022 06:56:56 -0800 (PST)
X-Received: by 2002:a05:6808:9b2:: with SMTP id e18mr5252752oig.168.1641999416406;
Wed, 12 Jan 2022 06:56:56 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Wed, 12 Jan 2022 06:56:56 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=47.190.140.76; posting-account=dZLQ6QoAAAAhUB7R57MgIpe3ohnjZHi8
NNTP-Posting-Host: 47.190.140.76
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3d8d0de6-9e95-4a8c-9aab-07f5e593563cn@googlegroups.com>
Subject: Filling MBASIC strings from ML.
From: thom.che...@gmail.com (Thom Cherryhomes)
Injection-Date: Wed, 12 Jan 2022 14:56:56 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 2
 by: Thom Cherryhomes - Wed, 12 Jan 2022 14:56 UTC

Hello everyone, Am currently trying to write a set of bindings for #FujiNet to manipulate buffers in memory to MBASIC strings (e.g. to get the received data from the network, into a string), Has anyone written any routines to do this?

-Thom

Re: Filling MBASIC strings from ML.

<srr4e0$1afr$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=3032&group=comp.os.cpm#3032

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!6v331KAmfPVMYFUqp+JbLA.user.46.165.242.75.POSTED!not-for-mail
From: this.is....@so.its.invalid (Martin)
Newsgroups: comp.os.cpm
Subject: Re: Filling MBASIC strings from ML.
Date: Fri, 14 Jan 2022 07:12:51 +0100
Organization: Aioe.org NNTP Server
Message-ID: <srr4e0$1afr$1@gioia.aioe.org>
References: <3d8d0de6-9e95-4a8c-9aab-07f5e593563cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="43515"; posting-host="6v331KAmfPVMYFUqp+JbLA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 SeaMonkey/2.17.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin - Fri, 14 Jan 2022 06:12 UTC

Am 01/12/2022 03:56 PM, Thom Cherryhomes schrieb:
> Hello everyone, Am currently trying to write a set of bindings for #FujiNet to manipulate buffers in memory to MBASIC strings (e.g. to get the received data from the network, into a string), Has anyone written any routines to do this?
>
> -Thom
>

I have not found any working code, but this really good
description should provide everything you need.

On the "CP/M CD-ROM": /CPM/MSOFT/M-SOFT.CAT

You could precreate a string with the required maximum length,
then use it as a fixed length IN/OUT buffer.

You are not allowed to modify the string length, so you could
an additional integer paramter and pass the used length there.

Use "MID$" to R/W your data, like so...

Initialize a buffer with the required length.

110 X$="1234567890"
120 L=0

A$ holds the string you want to pass in.

210 L=LEN(A$)
220 MID$(X$,1,L)=A$

[...] Your CALL here need to pass X$ and L

B$ gets the returned string.

300 B$=MID$(A$,1,L)

HTH Martin

Re: Filling MBASIC strings from ML.

<ss040n$6pg$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=3035&group=comp.os.cpm#3035

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!7C3ZaNST1zIp1vocOgJaEA.user.46.165.242.75.POSTED!not-for-mail
From: this.is....@so.its.invalid (Martin)
Newsgroups: comp.os.cpm
Subject: Re: Filling MBASIC strings from ML.
Date: Sun, 16 Jan 2022 04:36:22 +0100
Organization: Aioe.org NNTP Server
Message-ID: <ss040n$6pg$1@gioia.aioe.org>
References: <3d8d0de6-9e95-4a8c-9aab-07f5e593563cn@googlegroups.com> <srr4e0$1afr$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="6960"; posting-host="7C3ZaNST1zIp1vocOgJaEA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 SeaMonkey/2.17.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin - Sun, 16 Jan 2022 03:36 UTC

Am 01/14/2022 07:12 AM, Martin schrieb:
> Am 01/12/2022 03:56 PM, Thom Cherryhomes schrieb:
>> Hello everyone, Am currently trying to write a set of bindings for
>> #FujiNet to manipulate buffers in memory to MBASIC strings (e.g. to
>> get the received data from the network, into a string), Has anyone
>> written any routines to do this?
>>
>> -Thom
>>
>
> I have not found any working code, but this really good
> description should provide everything you need.
>
> On the "CP/M CD-ROM": /CPM/MSOFT/M-SOFT.CAT
>
>
> You could precreate a string with the required maximum length,
> then use it as a fixed length IN/OUT buffer.
>
> You are not allowed to modify the string length, so you could
> an additional integer paramter and pass the used length there.
>
> Use "MID$" to R/W your data, like so...
>
>
> Initialize a buffer with the required length.
>
> 110 X$="1234567890"
> 120 L=0
>
> A$ holds the string you want to pass in.
>
> 210 L=LEN(A$)
> 220 MID$(X$,1,L)=A$
>
> [...] Your CALL here need to pass X$ and L
>
> B$ gets the returned string.
>
> 300 B$=MID$(A$,1,L)
>
>
> HTH Martin
>

After actually trying out my suggestions,
I have to make a few corrections,

Initializing the string vith a constant assignment
does not allocate a buffer in the string area.

The passed string descriptor points directly to
the string constant in line 110 and writing over
it will change the program.

A string variable to be used as an OUT parameter
must get its value indirectly via a string operation.

So the following initialization works and saves a lot
of memory:

110 X$=SPACE$(10)
120 L=0

The assignment in line 220 saved my example from becoming
a total disaster.

But that was not enough, a typo in line 300:

300 B$=MID$(X$,1,L)

Oh well, Martin

Re: Filling MBASIC strings from ML.

<6616e58e-f26f-40fa-bcc0-498b81b91fa1n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=3038&group=comp.os.cpm#3038

 copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:f2f:: with SMTP id iw15mr8437788qvb.113.1642431194270;
Mon, 17 Jan 2022 06:53:14 -0800 (PST)
X-Received: by 2002:a05:6808:6d1:: with SMTP id m17mr21651721oih.139.1642431194040;
Mon, 17 Jan 2022 06:53:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Mon, 17 Jan 2022 06:53:13 -0800 (PST)
In-Reply-To: <ss040n$6pg$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=74.67.15.73; posting-account=VZyMUQoAAAD47CL2XgxFN8qIIaWjO0EH
NNTP-Posting-Host: 74.67.15.73
References: <3d8d0de6-9e95-4a8c-9aab-07f5e593563cn@googlegroups.com>
<srr4e0$1afr$1@gioia.aioe.org> <ss040n$6pg$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6616e58e-f26f-40fa-bcc0-498b81b91fa1n@googlegroups.com>
Subject: Re: Filling MBASIC strings from ML.
From: tla...@twcny.rr.com (Tom Lake)
Injection-Date: Mon, 17 Jan 2022 14:53:14 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 61
 by: Tom Lake - Mon, 17 Jan 2022 14:53 UTC

On Saturday, January 15, 2022 at 10:39:07 PM UTC-5, Martin wrote:
> Am 01/14/2022 07:12 AM, Martin schrieb:
> > Am 01/12/2022 03:56 PM, Thom Cherryhomes schrieb:
> >> Hello everyone, Am currently trying to write a set of bindings for
> >> #FujiNet to manipulate buffers in memory to MBASIC strings (e.g. to
> >> get the received data from the network, into a string), Has anyone
> >> written any routines to do this?
> >>
> >> -Thom
> >>
> >
> > I have not found any working code, but this really good
> > description should provide everything you need.
> >
> > On the "CP/M CD-ROM": /CPM/MSOFT/M-SOFT.CAT
> >
> >
> > You could precreate a string with the required maximum length,
> > then use it as a fixed length IN/OUT buffer.
> >
> > You are not allowed to modify the string length, so you could
> > an additional integer paramter and pass the used length there.
> >
> > Use "MID$" to R/W your data, like so...
> >
> >
> > Initialize a buffer with the required length.
> >
> > 110 X$="1234567890"
> > 120 L=0
> >
> > A$ holds the string you want to pass in.
> >
> > 210 L=LEN(A$)
> > 220 MID$(X$,1,L)=A$
> >
> > [...] Your CALL here need to pass X$ and L
> >
> > B$ gets the returned string.
> >
> > 300 B$=MID$(A$,1,L)
> >
> >
> > HTH Martin
> >
> After actually trying out my suggestions,
> I have to make a few corrections,
>
> Initializing the string vith a constant assignment
> does not allocate a buffer in the string area.
>
> The passed string descriptor points directly to
> the string constant in line 110 and writing over
> it will change the program.
>

You can also do this:

110 X$="123456789"+"0"

The concatenation will put it in the string area.

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor