Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.xharbour / Converting array to string

SubjectAuthor
* Converting array to stringrodrego sandino
+* Converting array to stringrodrego sandino
|`* Converting array to stringdlzc
| `- Converting array to stringrodrego sandino
`* Converting array to stringDaniele
 `* Converting array to stringrodrego sandino
  `* Converting array to stringDaniele
   `* Converting array to stringrodrego sandino
    `* Converting array to stringrodrego sandino
     +* Converting array to stringElla Stern
     |+* Converting array to stringDaniele
     ||+- Converting array to stringrodrego sandino
     ||`* Converting array to stringrodrego sandino
     || `- Converting array to stringdlzc
     |`- Converting array to stringrodrego sandino
     `- Converting array to stringDaniele

1
Converting array to string

<f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9941&group=comp.lang.xharbour#9941

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:5e12:: with SMTP id h18mr27230124qtx.253.1624982221674;
Tue, 29 Jun 2021 08:57:01 -0700 (PDT)
X-Received: by 2002:a05:620a:4e9:: with SMTP id b9mr30588390qkh.358.1624982221488;
Tue, 29 Jun 2021 08:57:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 29 Jun 2021 08:57:01 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=192.42.116.14; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 192.42.116.14
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
Subject: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Tue, 29 Jun 2021 15:57:01 +0000
Content-Type: text/plain; charset="UTF-8"
 by: rodrego sandino - Tue, 29 Jun 2021 15:57 UTC

Is there any way to convert an array to string where each element can be access directly like in MEMOREAD function when it reads file you can access each line in file easily by MEMOLINE function .

Re: Converting array to string

<1263692d-ae09-4463-aefa-d8646b54d025n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9942&group=comp.lang.xharbour#9942

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:65da:: with SMTP id t26mr7417071qto.308.1624994796303;
Tue, 29 Jun 2021 12:26:36 -0700 (PDT)
X-Received: by 2002:a0c:e1ce:: with SMTP id v14mr2420833qvl.30.1624994796110;
Tue, 29 Jun 2021 12:26:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 29 Jun 2021 12:26:35 -0700 (PDT)
In-Reply-To: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=209.127.17.242; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 209.127.17.242
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1263692d-ae09-4463-aefa-d8646b54d025n@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Tue, 29 Jun 2021 19:26:36 +0000
Content-Type: text/plain; charset="UTF-8"
 by: rodrego sandino - Tue, 29 Jun 2021 19:26 UTC

On Tuesday, June 29, 2021 at 3:57:02 PM UTC, rodrego sandino wrote:
> Is there any way to convert an array to string where each element can be access directly like in MEMOREAD function when it reads file you can access each line in file easily by MEMOLINE function .
to simplified my question i want to do the following :
Create an empty String Buffer object.
Traverse through the elements of the String array using loop.
In the loop, append each element of the array to the StringBuffer object using the append() method.
Finally convert the StringBuffer object to string using the toString() method.
How i can do that in xharbour ?

Re: Converting array to string

<e8c0d0a0-9d12-4139-884f-122e25823203n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9943&group=comp.lang.xharbour#9943

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:a47:: with SMTP id j7mr22254876qka.370.1625003621671;
Tue, 29 Jun 2021 14:53:41 -0700 (PDT)
X-Received: by 2002:a37:27cf:: with SMTP id n198mr629969qkn.256.1625003621475;
Tue, 29 Jun 2021 14:53:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 29 Jun 2021 14:53:41 -0700 (PDT)
In-Reply-To: <1263692d-ae09-4463-aefa-d8646b54d025n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.168.55.223; posting-account=7bF0GwoAAABMFHX6V4fON4-1F6LFJ834
NNTP-Posting-Host: 98.168.55.223
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com> <1263692d-ae09-4463-aefa-d8646b54d025n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e8c0d0a0-9d12-4139-884f-122e25823203n@googlegroups.com>
Subject: Re: Converting array to string
From: dlz...@cox.net (dlzc)
Injection-Date: Tue, 29 Jun 2021 21:53:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: dlzc - Tue, 29 Jun 2021 21:53 UTC

Dear sandin...:

On Tuesday, June 29, 2021 at 12:26:37 PM UTC-7, sandin...@gmail.com wrote:
> On Tuesday, June 29, 2021 at 3:57:02 PM UTC, rodrego sandino wrote:
> > Is there any way to convert an array to string where each
> > element can be access directly like in MEMOREAD function
> > when it reads file you can access each line in file easily by
> MEMOLINE function .

What do you know about the data type of the elements in the array? What do you know about the dimensonality of the arrays, as in how many parameters there are (uArray(1,2,3,4,5) := codestring)? If more than one dimension (row AND column), do you need to know "position"?

I'd use this as a template: https://github.com/harbour/core/blob/master/tests/foreach.prg

David A. Smith

Re: Converting array to string

<sbh5h1$mts$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9944&group=comp.lang.xharbour#9944

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: webmas...@appliserver.com (Daniele)
Newsgroups: comp.lang.xharbour
Subject: Re: Converting array to string
Date: Wed, 30 Jun 2021 09:12:31 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <sbh5h1$mts$1@dont-email.me>
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 30 Jun 2021 07:12:33 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="30781ca6da8484cf971a84ff01d4f8db";
logging-data="23484"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NnHtcJlq5STscbJIP5TrB"
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:OmeG1YyvuxlKMgeF1MsT8EklRJE=
In-Reply-To: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
Content-Language: it
 by: Daniele - Wed, 30 Jun 2021 07:12 UTC

Il 29/06/2021 17:57, rodrego sandino ha scritto:
> Is there any way to convert an array to string where each element can be access directly like in MEMOREAD function when it reads file you can access each line in file easily by MEMOLINE function .
>

aStrings:={"one","two","three"}

with a codeblock:

cString:=""
ascan(aStrings,{|x|cstring+=x+hb_eol()}) // hb_osNewLine in xHarbour
? cString

or with a function:

cString:=a2s(aStrings)
? CSTRING

func a2s(aArr)
local cRes:="",t
for t:=1 to len(aArr)
cRes=cRes+rtrim(aArr[t])+hb_eol() // hb_OsNewLine xHb","
next t
return cRes

Re: Converting array to string

<80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9945&group=comp.lang.xharbour#9945

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:7f88:: with SMTP id z8mr4370997qtj.296.1625084945821; Wed, 30 Jun 2021 13:29:05 -0700 (PDT)
X-Received: by 2002:ae9:f107:: with SMTP id k7mr38487782qkg.152.1625084945637; Wed, 30 Jun 2021 13:29:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.swapon.de!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.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.lang.xharbour
Date: Wed, 30 Jun 2021 13:29:05 -0700 (PDT)
In-Reply-To: <sbh5h1$mts$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2605:6400:30:fb03:1584:7631:b3fb:e6ba; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 2605:6400:30:fb03:1584:7631:b3fb:e6ba
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com> <sbh5h1$mts$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Wed, 30 Jun 2021 20:29:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 57
 by: rodrego sandino - Wed, 30 Jun 2021 20:29 UTC

On Wednesday, June 30, 2021 at 7:12:35 AM UTC, Daniele wrote:
> Il 29/06/2021 17:57, rodrego sandino ha scritto:
> > Is there any way to convert an array to string where each element can be access directly like in MEMOREAD function when it reads file you can access each line in file easily by MEMOLINE function .
> >
> aStrings:={"one","two","three"}
>
> with a codeblock:
>
> cString:=""
> ascan(aStrings,{|x|cstring+=x+hb_eol()}) // hb_osNewLine in xHarbour
> ? cString
>
> or with a function:
>
> cString:=a2s(aStrings)
> ? CSTRING
>
> func a2s(aArr)
> local cRes:="",t
> for t:=1 to len(aArr)
> cRes=cRes+rtrim(aArr[t])+hb_eol() // hb_OsNewLine xHb","
> next t
> return cRes
Thank you very much for your precious answer my dear brother i had implement your nice code but unfortunately it could not reconstruct the image file i have read it with MEMOREAD function and i put it in an array and i follow your code but the image could not be built again my code is as follow so please advice me what should i do :

procedure pStart()
StringPool := {}
cString := ""
GetFile := GetFile ( { {"Text","*.txt"}, {"Image","*.JPG" } } , ;
" Select File " , ;
, ;
, ;
) MyStr = MEMOREAD ( GetFile )
nline = MLCOUNT( MyStr , 254 )
FOR x = 1 TO nline STEP 1
vline = MEMOLINE( MyStr , 254 , x )
AADD( StringPool , vline)
Next
cString = ArrayToString ( StringPool )
RPWI_TH = FCREATE("C:\Users\Roklasfon\Desktop\Roklasfon.jpg",0)
FWRITE(RPWI_TH,cString)
FCLOSE(RPWI_TH)
return
Function ArrayToString ( aVessel )
Local cRes
cRes := ""
VesselLength = LEN(aVessel)
FOR t = 1 TO VesselLength STEP 1
cRes := cRes+RTRIM(aVessel[t])+hb_eol()
Next
Return cRes

Re: Converting array to string

<abd8f787-6e4c-4806-9920-87c091b2f3abn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9946&group=comp.lang.xharbour#9946

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:622a:1748:: with SMTP id l8mr9836390qtk.350.1625085063283; Wed, 30 Jun 2021 13:31:03 -0700 (PDT)
X-Received: by 2002:ac8:4655:: with SMTP id f21mr29139988qto.110.1625085063139; Wed, 30 Jun 2021 13:31:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.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.lang.xharbour
Date: Wed, 30 Jun 2021 13:31:02 -0700 (PDT)
In-Reply-To: <e8c0d0a0-9d12-4139-884f-122e25823203n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2605:6400:30:fb03:1584:7631:b3fb:e6ba; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 2605:6400:30:fb03:1584:7631:b3fb:e6ba
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com> <1263692d-ae09-4463-aefa-d8646b54d025n@googlegroups.com> <e8c0d0a0-9d12-4139-884f-122e25823203n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <abd8f787-6e4c-4806-9920-87c091b2f3abn@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Wed, 30 Jun 2021 20:31:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 18
 by: rodrego sandino - Wed, 30 Jun 2021 20:31 UTC

On Tuesday, June 29, 2021 at 9:53:42 PM UTC, dlzc wrote:
> Dear sandin...:
> On Tuesday, June 29, 2021 at 12:26:37 PM UTC-7, sandin...@gmail.com wrote:
> > On Tuesday, June 29, 2021 at 3:57:02 PM UTC, rodrego sandino wrote:
> > > Is there any way to convert an array to string where each
> > > element can be access directly like in MEMOREAD function
> > > when it reads file you can access each line in file easily by
> > MEMOLINE function .
> What do you know about the data type of the elements in the array? What do you know about the dimensonality of the arrays, as in how many parameters there are (uArray(1,2,3,4,5) := codestring)? If more than one dimension (row AND column), do you need to know "position"?
>
> I'd use this as a template: https://github.com/harbour/core/blob/master/tests/foreach.prg
>
> David A. Smith
The data type in array is string and array is single dimension array

Re: Converting array to string

<sbp472$oin$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9947&group=comp.lang.xharbour#9947

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: webmas...@appliserver.com (Daniele)
Newsgroups: comp.lang.xharbour
Subject: Re: Converting array to string
Date: Sat, 3 Jul 2021 09:39:10 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <sbp472$oin$1@dont-email.me>
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me>
<80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jul 2021 07:39:14 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="1c490dee4028af2d09abaa56a59e3fcc";
logging-data="25175"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zovvWmrQ1T6HEhU8sjVJS"
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:th+JziISLBRI+JK/HXjPqRmAI3E=
In-Reply-To: <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
Content-Language: it
 by: Daniele - Sat, 3 Jul 2021 07:39 UTC

Il 30/06/2021 22:29, rodrego sandino ha scritto:

> Thank you very much for your precious answer my dear brother i had implement your nice code but unfortunately it could not reconstruct the image file i have read it with MEMOREAD function and i put it in an array and i follow your code but the image could not be built again my code is as follow so please advice me what should i do :

Your approach is completely wrong, sorry. You are trying to read a jpg
image as a text with memoread(), this can't work.

Back to basics: memoread() reads text files.

A text file contains a limited range of bytes, used to store text,
usually in lines separated by a EOL, so that lines of text can be
counted and extracted.

A jpeg file is called a "binary" file. It contains raw bytes intended to
be interpreted differently than a text file. No EOL separes no lines. To
read such a file you should use Fread().

What are you trying to do exactly?

Dan

Re: Converting array to string

<1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9948&group=comp.lang.xharbour#9948

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a37:b6c5:: with SMTP id g188mr14636930qkf.92.1625506263548;
Mon, 05 Jul 2021 10:31:03 -0700 (PDT)
X-Received: by 2002:a05:620a:6c4:: with SMTP id 4mr15530164qky.57.1625506263296;
Mon, 05 Jul 2021 10:31:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!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.lang.xharbour
Date: Mon, 5 Jul 2021 10:31:02 -0700 (PDT)
In-Reply-To: <sbp472$oin$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=185.100.87.202; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 185.100.87.202
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me> <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
<sbp472$oin$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Mon, 05 Jul 2021 17:31:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 27
 by: rodrego sandino - Mon, 5 Jul 2021 17:31 UTC

On Saturday, July 3, 2021 at 7:39:16 AM UTC, Daniele wrote:
> Il 30/06/2021 22:29, rodrego sandino ha scritto:
>
> > Thank you very much for your precious answer my dear brother i had implement your nice code but unfortunately it could not reconstruct the image file i have read it with MEMOREAD function and i put it in an array and i follow your code but the image could not be built again my code is as follow so please advice me what should i do :
> Your approach is completely wrong, sorry. You are trying to read a jpg
> image as a text with memoread(), this can't work.
>
> Back to basics: memoread() reads text files.
>
> A text file contains a limited range of bytes, used to store text,
> usually in lines separated by a EOL, so that lines of text can be
> counted and extracted.
>
> A jpeg file is called a "binary" file. It contains raw bytes intended to
> be interpreted differently than a text file. No EOL separes no lines. To
> read such a file you should use Fread().
>
> What are you trying to do exactly?
>
> Dan
Thank you very much for your nice answer my dear brother ,so how i can reconstruct the image after i read with FRead() function as you saied?

Re: Converting array to string

<0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9949&group=comp.lang.xharbour#9949

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ae9:dc82:: with SMTP id q124mr11984030qkf.387.1625518626954;
Mon, 05 Jul 2021 13:57:06 -0700 (PDT)
X-Received: by 2002:a37:9244:: with SMTP id u65mr16226776qkd.46.1625518626727;
Mon, 05 Jul 2021 13:57:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Mon, 5 Jul 2021 13:57:06 -0700 (PDT)
In-Reply-To: <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=198.144.120.234; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 198.144.120.234
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me> <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
<sbp472$oin$1@dont-email.me> <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Mon, 05 Jul 2021 20:57:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: rodrego sandino - Mon, 5 Jul 2021 20:57 UTC

On Monday, July 5, 2021 at 5:31:04 PM UTC, rodrego sandino wrote:
> On Saturday, July 3, 2021 at 7:39:16 AM UTC, Daniele wrote:
> > Il 30/06/2021 22:29, rodrego sandino ha scritto:
> >
> > > Thank you very much for your precious answer my dear brother i had implement your nice code but unfortunately it could not reconstruct the image file i have read it with MEMOREAD function and i put it in an array and i follow your code but the image could not be built again my code is as follow so please advice me what should i do :
> > Your approach is completely wrong, sorry. You are trying to read a jpg
> > image as a text with memoread(), this can't work.
> >
> > Back to basics: memoread() reads text files.
> >
> > A text file contains a limited range of bytes, used to store text,
> > usually in lines separated by a EOL, so that lines of text can be
> > counted and extracted.
> >
> > A jpeg file is called a "binary" file. It contains raw bytes intended to
> > be interpreted differently than a text file. No EOL separes no lines. To
> > read such a file you should use Fread().
> >
> > What are you trying to do exactly?
> >
> > Dan
> Thank you very much for your nice answer my dear brother ,so how i can reconstruct the image after i read with FRead() function as you saied?

I had reconstruct the image as you said by using FRead and Fwrite .
but i want to ask you question as you said before that MEMOREAD and MEMOWRITE are used to read text files only but i have used them to read image files before and it works by reading the image with MEMOREAD to string and read string again to file and it works but when i put the string in an array and try to reconstruct the string again in order to rebuild the image again it fails that is why i ask in the beginning how to convert an array of string to a single string so if you could help me to do that i will be thankful for you my dear brother.

Re: Converting array to string

<4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9950&group=comp.lang.xharbour#9950

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:6214:5098:: with SMTP id kk24mr14579574qvb.26.1625520074759; Mon, 05 Jul 2021 14:21:14 -0700 (PDT)
X-Received: by 2002:a37:8581:: with SMTP id h123mr16171711qkd.316.1625520074534; Mon, 05 Jul 2021 14:21:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.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.lang.xharbour
Date: Mon, 5 Jul 2021 14:21:14 -0700 (PDT)
In-Reply-To: <0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.79.141.117; posting-account=H3ofRwoAAADbRxQ3Wi989fFKCMQ4Av_J
NNTP-Posting-Host: 82.79.141.117
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com> <sbh5h1$mts$1@dont-email.me> <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com> <sbp472$oin$1@dont-email.me> <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com> <0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
Subject: Re: Converting array to string
From: ellail...@gmail.com (Ella Stern)
Injection-Date: Mon, 05 Jul 2021 21:21:14 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: Ella Stern - Mon, 5 Jul 2021 21:21 UTC

"... but when i put the string in an array and try to reconstruct the string again in order to rebuild the image again it fails that is why i ask in the beginning how to convert an array of string to a single string..."

In xHarbour the Array IS NOT implemented as in C or C++ the "dense array", and strings cannot include the NULL character (most of the time the blob objects are including NULL characters).
The right way to work with image, sound, video etc. files is to handle them as blob objects when reading from or writing into a local file.
Sending or receiving them over https is a different subject matter.

Re: Converting array to string

<sc0mdk$91r$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9951&group=comp.lang.xharbour#9951

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: webmas...@appliserver.com (Daniele)
Newsgroups: comp.lang.xharbour
Subject: Re: Converting array to string
Date: Tue, 6 Jul 2021 06:32:45 +0200
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <sc0mdk$91r$1@dont-email.me>
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me>
<80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
<sbp472$oin$1@dont-email.me>
<1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
<0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Jul 2021 04:32:52 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6b3d4403762e5b8d3ea72e4da80bd351";
logging-data="9275"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kFClg8CRpXlHFJ1rXKmx5"
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:OHTPt09q/i4Uh5HJ7CBJIZw/OTk=
In-Reply-To: <0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com>
Content-Language: it
 by: Daniele - Tue, 6 Jul 2021 04:32 UTC

Il 05/07/2021 22:57, rodrego sandino ha scritto:
>
> I had reconstruct the image as you said by using FRead and Fwrite .
> but i want to ask you question as you said before that MEMOREAD and MEMOWRITE are used to read text files only but i have used them to read image files before and it works by reading the image with MEMOREAD to string and read string again to file and it works

I was not aware of the fact that memoread() reads everything and can
handle binary files. I never used it that way. Good to know that it is a
very robust function!

but when i put the string in an array and try to reconstruct the
string again in order to rebuild the image again it fails that is why i
ask in the beginning how to convert an array of string to a single
string so if you could help me to do that i will be thankful for you my
dear brother.
>

See the answer from Ella
Dan

Re: Converting array to string

<sc0nhk$dnm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9952&group=comp.lang.xharbour#9952

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: webmas...@appliserver.com (Daniele)
Newsgroups: comp.lang.xharbour
Subject: Re: Converting array to string
Date: Tue, 6 Jul 2021 06:51:58 +0200
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <sc0nhk$dnm$1@dont-email.me>
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me>
<80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
<sbp472$oin$1@dont-email.me>
<1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
<0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com>
<4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Jul 2021 04:52:04 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6b3d4403762e5b8d3ea72e4da80bd351";
logging-data="14070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18abaUpse33dHtmpgWmXRzY"
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:oUgwFL08mHPi7mNTywFOwwRR0q4=
In-Reply-To: <4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
Content-Language: it
 by: Daniele - Tue, 6 Jul 2021 04:51 UTC

Il 05/07/2021 23:21, Ella Stern ha scritto:
>
> "... but when i put the string in an array and try to reconstruct the string again in order to rebuild the image again it fails that is why i ask in the beginning how to convert an array of string to a single string..."
>
> In xHarbour the Array IS NOT implemented as in C or C++ the "dense array", and strings cannot include the NULL character (most of the time the blob objects are including NULL characters).
> The right way to work with image, sound, video etc. files is to handle them as blob objects when reading from or writing into a local file.
> Sending or receiving them over https is a different subject matter.
>
To answer the OP, it would be possible then to use hb_Base64Encode() to
fill the array with "chunks" of the original file encoded as pure ASCII.
To reconstruct the file every line of the array will be decoded with
hb_Base64Decode().

Dan

Re: Converting array to string

<ef869b28-c817-4c1b-ade3-761757ee63c0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9954&group=comp.lang.xharbour#9954

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:578c:: with SMTP id v12mr19143614qta.254.1625597174508;
Tue, 06 Jul 2021 11:46:14 -0700 (PDT)
X-Received: by 2002:ac8:5a03:: with SMTP id n3mr5039536qta.303.1625597174278;
Tue, 06 Jul 2021 11:46:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 6 Jul 2021 11:46:13 -0700 (PDT)
In-Reply-To: <sc0nhk$dnm$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a0b:f4c0:16c:16:0:0:0:1;
posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 2a0b:f4c0:16c:16:0:0:0:1
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me> <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
<sbp472$oin$1@dont-email.me> <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
<0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com> <4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
<sc0nhk$dnm$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ef869b28-c817-4c1b-ade3-761757ee63c0n@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Tue, 06 Jul 2021 18:46:14 +0000
Content-Type: text/plain; charset="UTF-8"
 by: rodrego sandino - Tue, 6 Jul 2021 18:46 UTC

On Tuesday, July 6, 2021 at 4:52:06 AM UTC, Daniele wrote:
> Il 05/07/2021 23:21, Ella Stern ha scritto:
> >
> > "... but when i put the string in an array and try to reconstruct the string again in order to rebuild the image again it fails that is why i ask in the beginning how to convert an array of string to a single string..."
> >
> > In xHarbour the Array IS NOT implemented as in C or C++ the "dense array", and strings cannot include the NULL character (most of the time the blob objects are including NULL characters).
> > The right way to work with image, sound, video etc. files is to handle them as blob objects when reading from or writing into a local file.
> > Sending or receiving them over https is a different subject matter.
> >
> To answer the OP, it would be possible then to use hb_Base64Encode() to
> fill the array with "chunks" of the original file encoded as pure ASCII.
> To reconstruct the file every line of the array will be decoded with
> hb_Base64Decode().
>
> Dan
can you explain that with simple example? so the i can understand it easly

Re: Converting array to string

<712e2fa8-2aee-4a42-9442-c14323cf7c32n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9955&group=comp.lang.xharbour#9955

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:294b:: with SMTP id n11mr13787018qkp.63.1625597668380; Tue, 06 Jul 2021 11:54:28 -0700 (PDT)
X-Received: by 2002:a05:620a:4e9:: with SMTP id b9mr20790657qkh.358.1625597668233; Tue, 06 Jul 2021 11:54:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.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.lang.xharbour
Date: Tue, 6 Jul 2021 11:54:28 -0700 (PDT)
In-Reply-To: <4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a0b:f4c0:16c:16:0:0:0:1; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 2a0b:f4c0:16c:16:0:0:0:1
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com> <sbh5h1$mts$1@dont-email.me> <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com> <sbp472$oin$1@dont-email.me> <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com> <0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com> <4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <712e2fa8-2aee-4a42-9442-c14323cf7c32n@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Tue, 06 Jul 2021 18:54:28 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: rodrego sandino - Tue, 6 Jul 2021 18:54 UTC

On Monday, July 5, 2021 at 9:21:15 PM UTC, Ella Stern wrote:
> "... but when i put the string in an array and try to reconstruct the string again in order to rebuild the image again it fails that is why i ask in the beginning how to convert an array of string to a single string..."
>
> In xHarbour the Array IS NOT implemented as in C or C++ the "dense array", and strings cannot include the NULL character (most of the time the blob objects are including NULL characters).
> The right way to work with image, sound, video etc. files is to handle them as blob objects when reading from or writing into a local file.
> Sending or receiving them over https is a different subject matter.
ok..... how can i make blob object in xharbour ?and how i deal with them? please can you explain that with example?

Re: Converting array to string

<ebc91e45-9cdb-48a9-bbff-58671185402bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9957&group=comp.lang.xharbour#9957

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a37:c81:: with SMTP id 123mr23369447qkm.299.1625998072360;
Sun, 11 Jul 2021 03:07:52 -0700 (PDT)
X-Received: by 2002:a05:620a:22e4:: with SMTP id p4mr46191188qki.131.1625998072174;
Sun, 11 Jul 2021 03:07:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Sun, 11 Jul 2021 03:07:51 -0700 (PDT)
In-Reply-To: <sc0nhk$dnm$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=185.100.87.202; posting-account=kOaMbAoAAADBi_KIblwKo-rtDchXiP8x
NNTP-Posting-Host: 185.100.87.202
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me> <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
<sbp472$oin$1@dont-email.me> <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
<0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com> <4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
<sc0nhk$dnm$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ebc91e45-9cdb-48a9-bbff-58671185402bn@googlegroups.com>
Subject: Re: Converting array to string
From: sandinis...@gmail.com (rodrego sandino)
Injection-Date: Sun, 11 Jul 2021 10:07:52 +0000
Content-Type: text/plain; charset="UTF-8"
 by: rodrego sandino - Sun, 11 Jul 2021 10:07 UTC

On Tuesday, July 6, 2021 at 4:52:06 AM UTC, Daniele wrote:
> Il 05/07/2021 23:21, Ella Stern ha scritto:
> >
> > "... but when i put the string in an array and try to reconstruct the string again in order to rebuild the image again it fails that is why i ask in the beginning how to convert an array of string to a single string..."
> >
> > In xHarbour the Array IS NOT implemented as in C or C++ the "dense array", and strings cannot include the NULL character (most of the time the blob objects are including NULL characters).
> > The right way to work with image, sound, video etc. files is to handle them as blob objects when reading from or writing into a local file.
> > Sending or receiving them over https is a different subject matter.
> >
> To answer the OP, it would be possible then to use hb_Base64Encode() to
> fill the array with "chunks" of the original file encoded as pure ASCII.
> To reconstruct the file every line of the array will be decoded with
> hb_Base64Decode().
>
> Dan
Thank you very much my dear brother it works ....you help me a lot...thank you very much.
i have other question for you please ...how i can convert text file to PDF file in xHarbour ?

Re: Converting array to string

<84f78006-f903-442d-b48f-a4556d218d26n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9958&group=comp.lang.xharbour#9958

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:5f83:: with SMTP id j3mr5918104qta.149.1626209321828;
Tue, 13 Jul 2021 13:48:41 -0700 (PDT)
X-Received: by 2002:ac8:45cf:: with SMTP id e15mr5528991qto.347.1626209321636;
Tue, 13 Jul 2021 13:48:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 13 Jul 2021 13:48:41 -0700 (PDT)
In-Reply-To: <ebc91e45-9cdb-48a9-bbff-58671185402bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=68.107.209.13; posting-account=7bF0GwoAAABMFHX6V4fON4-1F6LFJ834
NNTP-Posting-Host: 68.107.209.13
References: <f1b5915f-8e79-419e-8704-57c90b1921f2n@googlegroups.com>
<sbh5h1$mts$1@dont-email.me> <80d0a208-74f8-4601-a366-b789cbf70e1en@googlegroups.com>
<sbp472$oin$1@dont-email.me> <1875fa66-d260-41f8-b21c-4d5d3769349cn@googlegroups.com>
<0ae74b22-2c51-4ab7-bcba-d911d97a84ben@googlegroups.com> <4928bfcc-d156-4ad6-bab6-a4b1fdfea2d1n@googlegroups.com>
<sc0nhk$dnm$1@dont-email.me> <ebc91e45-9cdb-48a9-bbff-58671185402bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <84f78006-f903-442d-b48f-a4556d218d26n@googlegroups.com>
Subject: Re: Converting array to string
From: dlz...@cox.net (dlzc)
Injection-Date: Tue, 13 Jul 2021 20:48:41 +0000
Content-Type: text/plain; charset="UTF-8"
 by: dlzc - Tue, 13 Jul 2021 20:48 UTC

> how i can convert text file to PDF file in xHarbour ?

https://groups.google.com/g/comp.lang.xharbour/c/WiguItHVeOg/m/kM532U6Y3eMJ

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor