Post by angelo2449 on Aug 9, 2020 4:48:59 GMT -5
Hi guys,
A strange thing happens to me!
In this code I can't memorize the string> StringaIn $ <if I value it inside, everything works fine!
I've written hundreds of programs like this and they work great!
Thank you
A strange thing happens to me!
In this code I can't memorize the string> StringaIn $ <if I value it inside, everything works fine!
I've written hundreds of programs like this and they work great!
Thank you
nomainwin
WindowWidth = 440
WindowHeight = 445
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$ = "cyan"
ForegroundColor$ = "black"
texteditor #main.edit1, -400, -400, 400, 25
xa = 10
statictext #main.t1, "Lunghezza ..... mt. >>>", xa + 20, 20, 230, 20
TextboxColor$ = "white"
textbox #main.lungh, xa + 280, 15, 100, 25
statictext #main.t2, "Altezza ....... mt. >>>", xa + 20, 55, 230, 20
TextboxColor$ = "yellow"
textbox #main.alt, xa + 280, 50, 100, 25
statictext #main.t3, "Numero Parti simili >>>", xa + 20, 90, 230, 20
textbox #main.nps, xa + 280, 85, 100, 25
statictext #main.piu, "+", xa + 20, 130, 10, 20
textbox #main.p1, xa + 40, 125, 80, 25
textbox #main.p2, xa + 125, 125, 80, 25
textbox #main.p3, xa + 210, 125, 80, 25
statictext #main.np, "nps", xa + 295, 130, 30, 20
textbox #main.pnps, xa + 330, 125, 50, 25
ya = 35
statictext #main.t4, "1a Detrazione ..... >>>", xa + 20, ya + 140, 230, 20
TextboxColor$ = "white"
textbox #main.det1, xa + 280, ya + 135, 100, 25
statictext #main.t5, "2a Detrazione ..... >>>", xa + 20, ya + 175, 230, 20
textbox #main.det2, xa + 280, ya + 170, 100, 25
statictext #main.t6, "3a Detrazione ..... >>>", xa + 20, ya + 210, 230, 20
textbox #main.det3, xa + 280, ya + 205, 100, 25
statictext #main.t7, "4a Detrazione ..... >>>", xa + 20, ya + 245, 230, 20
textbox #main.det4, xa + 280, ya + 240, 100, 25
button #main.info, "Info", [Info], UL, xa + 20, ya + 285, 100, 40
button #main.pul, "Pulisci", [Pulisci], UL, xa + 130, ya + 285, 100, 40
button #main.conf, "Conferma", [Conferma], UL, xa + 240, ya + 285, 140, 40
open "Preventivi - Superfici verticali" for window as #main
#main, "font courier_new 10 17 bold"
#main, "trapclose [quit.main]"
#main.lungh, "!setfocus"
#main.edit1, "!cls";
#main.edit1, "!paste";
#main.edit1, "!contents? StringaIn$";
StringaIn$ = trim$(StringaIn$)
'StringaIn$ = "30.64#1.50#1.60#1.50#1.60#1.50#1.60#1.50#1
print "StringaIn$ >>> "; StringaIn$
Pos1 = instr(trim$(StringaIn$), "#", 1)
Pos2 = instr(trim$(StringaIn$), "#", Pos1 + 1)
Pos3 = instr(trim$(StringaIn$), "#", Pos2 + 1)
Pos4 = instr(trim$(StringaIn$), "#", Pos3 + 1)
Pos5 = instr(trim$(StringaIn$), "#", Pos4 + 1)
Pos6 = instr(trim$(StringaIn$), "#", Pos5 + 1)
Pos7 = instr(trim$(StringaIn$), "#", Pos6 + 1)
Pos8 = instr(trim$(StringaIn$), "#", Pos7 + 1)
Lunghezza$ = left$(StringaIn$, Pos1 - 1)
Det1d1$ = mid$(StringaIn$, Pos1 + 1, Pos2 - Pos1 - 1)
Det2d1$ = mid$(StringaIn$, Pos2 + 1, Pos3 - Pos2 - 1)
Det1d2$ = mid$(StringaIn$, Pos3 + 1, Pos4 - Pos3 - 1)
Det2d2$ = mid$(StringaIn$, Pos4 + 1, Pos5 - Pos4 - 1)
Det1d3$ = mid$(StringaIn$, Pos5 + 1, Pos6 - Pos5 - 1)
Det2d3$ = mid$(StringaIn$, Pos6 + 1, Pos7 - Pos6 - 1)
Det1d4$ = mid$(StringaIn$, Pos7 + 1, Pos8 - Pos7 - 1)
Det2d4$ = mid$(StringaIn$, Pos8 + 1)
Det1 = val(Det1d1$) * val(Det2d1$)
Det2 = val(Det1d2$) * val(Det2d2$)
Det3 = val(Det1d3$) * val(Det2d3$)
Det4 = val(Det1d4$) * val(Det2d4$)
#main.lungh, using("#####.##", val(Lunghezza$))
#main.alt, using("#####.##", val(Altezza$))
#main.nps, using("#####.##", val(NumPartiSim$))
#main.det1, using("#####.##", Det1)
#main.det2, using("#####.##", Det2)
#main.det3, using("#####.##", Det3)
#main.det4, using("#####.##", Det4)
#main.p1, using("###.##", val(Piu1$))
#main.p2, using("###.##", val(Piu2$))
#main.p3, using("###.##", val(Piu3$))
#main.pnps, using("###", val(PnPS$))
wait
' ----------------------------
[Conferma]
#main.lungh, "!contents? Lunghezza$"
Lunghezza$ = trim$(Lunghezza$)
#main.alt, "!contents? Altezza$"
Altezza$ = trim$(Altezza$)
#main.nps, "!contents? "
NumPartiSim$ = trim$(NumPartiSim$)
#main.det1, "!contents? Det1$"
Det1$ = trim$(Det1$)
#main.det2, "!contents? Det2$"
Det2$ = trim$(Det2$)
#main.det3, "!contents? Det3$"
Det3$ = trim$(Det3$)
#main.det4, "!contents? Det4$"
Det4$ = trim$(Det4$)
#main.p1, "!contents? Piu1$"
Piu1$ = trim$(Piu1$)
#main.p2, "!contents? Piu2$"
Piu2$ = trim$(Piu2$)
#main.p3, "!contents? Piu3$"
Piu3$ = trim$(Piu3$)
#main.pnps, "!contents? PnPS$"
PnPS$ = trim$(PnPS$)
StringaOut$ = Lunghezza$ + "#" + Altezza$ + "#" + NumPartiSim$ + "#" + Det1$ + "#" + Det2$ + "#" + Det3$ + "#" + Det4$ +_
Piu1$ + "#" + Piu2$ + "#" + Piu3$ + "#" + PnPS$ ''16.00#2.70#1#1.60#2.20#2.50#1.901.35#2.24#1.78#2
#main.edit1, "!cls";
#main.edit1, StringaOut$;
#main.edit1, "!selectall";
#main.edit1, "!copy";
close #main
end
' ----------------------------
[Info]
open "C:\AutocadSupporto\Info\InfoSupporto.txt" for output as #7
print #7, "SupVert"
close #7
if FileExists("C:\AutocadSupporto\LibertyTre\InfoSupporto.exe") then
run "C:\AutocadSupporto\LibertyTre\InfoSupporto.exe " + "C:\AutocadSupporto\LibertyTre\InfoSupporto.tkn"
end if
wait
' ----------------------------
[Pulisci]
#main.lungh, ""
#main.alt, ""
#main.nps, ""
#main.det1, ""
#main.det2, ""
#main.det3, ""
#main.det4, ""
#main.p1, ""
#main.p2, ""
#main.p3, ""
#main.pnps, ""
#main.lungh, "!setfocus"
wait
' ----------------------------
[quit.main]
#main.edit1, "!cls";
#main.edit1, "Fine";
#main.edit1, "!selectall";
#main.edit1, "!copy";
close #main
end
' ----------------------------
function FileExists(FilePath$)
dim FileExistsInfo$(1,1)
files "", FilePath$, FileExistsInfo$(
FileExists = val(FileExistsInfo$(0,0))
end function
' ----------------------------------