|
Post by angelo2449 on Jan 12, 2022 14:44:48 GMT -5
Hi guys,
I want to obtain, from the string obtained from the> texeditor <, an entire string. The string I get with the command: #main.desc, "!contents? Desc$"; is a multi-line :
Ponteggio a telaio con altezze anche oltre i 20 m pr
odotto da azienda in possesso di autorizzazione mini
steriale ed eseguito con l'impiego di tubi di mm. 48
mm e spessore pari a 2,9 mm, in acciaio zincato o ve
rniciato, XXX
Is there any way to get a entire string?
Thank you
|
|
|
Post by Rod on Jan 12, 2022 15:02:18 GMT -5
There are hidden control characters in the text you retrieve. New line markers, most likely chr$(13) and chr$(10) you can remove those characters with the string handler replstr$() there should be an example in the help file. Not at my pc right now.
Print the asc value of the characters within Desc$ to see how it is built up. Do a for next loop and use mid$ to print the asc value . Ie for I = 1 to len(Desc$) print asc(mid$(Desc$,i,1)) next
|
|
|
Post by angelo2449 on Jan 12, 2022 15:36:09 GMT -5
Thanks Rod, maybe there are control characters, but this code:
#main.cod, "!contents? Codice$" #main.desc, "!contents? Desc$";
#main.um, "!contents? Um$" #main.prezzo, "!contents? Prezzo$"
Codice$ = trim$(Codice$) Desc$ = trim$(Desc$) Um$ = trim$(Um$) Prezzo$ = trim$(Prezzo$)
'open SelectedFile$ for output as #3 'print #3, Codice$
NumRighe = len(Desc$) / 52 Fraz = NumRighe - int(NumRighe) if Fraz > 0 then NumRighe = int(NumRighe) + 1 print "NumRighe "; NumRighe DescTot$ = ""
for u = 1 to NumRighe Riga1$ = left$(Desc$, 52) Desc$ = mid$(Desc$, 53) DescTot$ = DescTot$ + Riga1$ next u
print "XXXXXXX "; DescTot$
I should have the whole string, but no!
|
|
|
Post by klewlis on Jan 12, 2022 20:09:45 GMT -5
|
|
|
Post by klewlis on Jan 12, 2022 20:12:44 GMT -5
|
|
|
Post by tsh73 on Jan 13, 2022 4:27:31 GMT -5
I still dunno what "whole string" is but in case we want to concatenate lines we should just replace CR LF to space. Single line.
Desc$ = replstr$(Desc$ , chr$(13)+chr$(10), " ") Just press that button and look at the mainwin.
' Form created with the help of Freeform-J v.261006 ' Generated on Jan 13, 2022 at 12:16:48
' nomainwin
WindowWidth = 550 WindowHeight = 410
UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
texteditor #main.desc, 26, 16, 208, 220 button #main.button2, "Button Caption", [button2Click], UL, 278, 26, 122, 25 menu #main, "Edit" '<--- Texteditor Menu can be moved but not removed.
open "untitled" for window as #main print #main, "trapclose [quit.main]"
print #main, "font ms_sans_serif 10"
#main.desc "Old Macdougal had a farm in Ohio-i-o," #main.desc "And on that farm he had some dogs in Ohio-i-o," #main.desc "With a bow-wow here, and a bow-wow there," #main.desc "Here a bow, there a wow, everywhere a bow-wow."
wait
[quit.main] Close #main END
[button2Click] 'Perform action for the button named 'button2' #main.desc, "!contents? Desc$"; Desc$ = trim$(Desc$) print ">";Desc$;"<" '4 lines
' Desc$ = replstr$(Desc$ , chr$(13), " ") ' Desc$ = replstr$(Desc$ , chr$(10), " ") Desc$ = replstr$(Desc$ , chr$(13)+chr$(10), " ") print ">";Desc$;"<" '1 line
wait
|
|
|
Post by Rod on Jan 13, 2022 11:42:30 GMT -5
Yeah, like tsh73 I am confused. We started with one problem where the whole string was retrieved but was multi line? Now we are parsing the whole string to a file (badly) and with no need. Just print the whole string to the file.
Think we need to hear what the problem actually is.
|
|