Page 1 of 2
StandBySystem
Posted: Mon Apr 25, 2022 11:40 pm
by Olli
Here is a very very short version using our beautiful system made by the PB team.
Have a good idea !
Code: Select all
Procedure RefTextFile(C$)
File = ReadFile(#PB_Any, #PB_Compiler_Home + "SDK/CompilerInterface.txt")
If C$: Choice = Val(C$): EndIf
While Not Eof(File)
Text$ = ReplaceString(ReplaceString(ReadString(File), "<T>", "^"), Chr(9), " ")
If Text$
If LTrim(Text$) = Text$
If Left(Text$, 7) = "Example": Break: EndIf
Display | Bool(Left(Text$, 3) = "END")
If Display
CmdNo + 1
If Choice: Help = Bool(Choice = CmdNo): EndIf
If C$ = "": PrintN(Str(CmdNo) + ": " + Text$): EndIf
EndIf
EndIf
If Help: PrintN(Text$): EndIf
EndIf
Wend
CloseFile(File)
EndProcedure
Procedure.S TB(E.S) ; TaBulation
ProcedureReturn ReplaceString(E, "^", Chr(9) )
EndProcedure
FullName$ = #PB_Compiler_Home + "compilers/pbcompiler"
Param$ = "/standby"
Flag = #PB_Program_Hide | #PB_Program_Read | #PB_Program_Open | #PB_Program_Write
Prog = RunProgram(FullName$, Param$, "", Flag)
OpenConsole()
Repeat
Delay(100)
If AvailableProgramOutput(Prog)
T$ = ""
Repeat
S$ = ReadProgramString(Prog)
T$ + C$ + Chr(13)
PrintN(S$)
Until S$ = "READY" Or S$ = TB("OUTPUT^COMPLETE") Or S$ = "UNKNOWN"
SetClipboardText(T$)
EndIf
A$ = Trim(Input() )
C$ = UCase(TB(A$) )
RefTextFile(C$)
If ProgramRunning(Prog)
WriteProgramStringN(Prog, C$)
Delay(100)
Else
End
EndIf
Until ProgramRunning(Prog) = 0
CloseConsole()
CloseProgram(Prog)
// Moved from "Tricks 'n' Tips" to "Off Topic" (Kiffi)
Re: StandBySystem
Posted: Tue Apr 26, 2022 3:23 am
by Keya
can you please provide some preface information as to what this does? thankyou

You say "Have a good idea !" ... how can I have a good idea about it when you've given me no idea what it's about!?!?
(I get so frustrated by seeing undocumented code like this - which might be AMAZING code - but it requires that we compile it and go line-by-line trying to analyse and make up our own understanding of what might be going on, which might be quite different to the authors intent) ... and do you really expect people to understand what this means just by the title "StandBySystem"??? that just adds more questions than it answers! I have NO idea what on earth "StandBySystem" is!
I mean no disrespect from my Devils Advocate view!

I just request that we provide explanation to accompany our source code
Re: StandBySystem
Posted: Tue Apr 26, 2022 8:16 am
by Olli
Hello keya ! When I will have time for it, I will add more infos. What it is sure is this source code is absolutely non-commercial. The name in the title is just a shortcut that I use to present it. And this source code cannot technically be compiled (and will never be compilable)
Re: StandBySystem
Posted: Tue Apr 26, 2022 8:35 am
by BarryG
Olli wrote: Tue Apr 26, 2022 8:16 am
Hello keya ! When I will have time for it, I will add more infos. What it is sure is this source code is absolutely non-commercial. The name in the title is just a shortcut that I use to present it. And this source code
cannot technically be compiled (and will never be compilable)
If the above can't be compiled, and never can be, and has no use at the moment; then why are you posting it here as a tip or trick?
Re: StandBySystem
Posted: Tue Apr 26, 2022 8:55 am
by Olli
99% of the numeric systems in the world, have not a notice in the industries. So just think simple. What do you we do so simply when we discover a cursor in a screen prompt ?
Re: StandBySystem
Posted: Tue Apr 26, 2022 9:09 am
by HeX0R
Olli wrote: Tue Apr 26, 2022 8:55 am
99% of the numeric systems in the world, have not a notice in the industries. So just think simple. What do you we do so simply when we discover a cursor in a screen prompt ?
Ah, you mean when characters go fishing, which timestamp would the darknet consider to be valid?
Seriously:
Please throw your translator into the river!
Re: StandBySystem
Posted: Tue Apr 26, 2022 9:12 am
by ar-s
Press Enter the type for example : FUNCTIONLIST
Re: StandBySystem
Posted: Tue Apr 26, 2022 9:17 am
by Marc56us
Be curious, open the file: #PB_Compiler_Home + "SDK/
CompilerInterface.txt"
Read, then look at the code, you will understand
"
When the compiler is started with the /STANDBY (Windows) or --standby (Linux/Mac) switch,
the compiler will wait for commands on the standard input and give any responds to commands
on the standard output. This allows to control the compiler from any language or script that
is able to access the standard pipes of a program [...]"
Re: StandBySystem
Posted: Tue Apr 26, 2022 11:04 am
by Olli
Thank you friends. You can just press [Enter] to start. And I did not want to add such a help message after the native message of introduction of the compiler.
Hello Kiffi, nice to see your best signature !
Re: StandBySystem
Posted: Thu Apr 28, 2022 6:15 am
by Keya
Olli thanks for not taking offense to my comment, I was having a bad day (not an excuse!)
Re: StandBySystem
Posted: Thu Apr 28, 2022 10:12 am
by Olli
There is no problem ! Other people also inform me that I am not easy to read. Also, not only do I keep a poor level in English expression, but, in addition, I approach complicated subjects. So I understand the comments. It's about design, ergonomics, purpose: for these things, I have to keep listening, whatever the criticism.
Re: StandBySystem
Posted: Thu Apr 28, 2022 10:46 am
by Rinzwind
Garbage in, garbage out.
Next time, please add the original language, the one which you are best at. Have a hard time figuring out what can possibly been written. Seems random words thrown together.
Tomorrow I buy snack and because these stink I add vegetables and prepare red sticks.
Re: StandBySystem
Posted: Thu Apr 28, 2022 11:19 pm
by idle
Why did kiffi move the post to off topic it's actually a good tip for those that would like to use the compiler in standby mode. Thanks for the code Olli.
Re: StandBySystem
Posted: Fri Apr 29, 2022 4:37 am
by Olli
Rinzwind wrote:Tomorrow I buy snack and because these stink I add vegetables and prepare red sticks.
When you can't find the menu in a program, you simply give yours!
Rinzwind wrote:Garbage in, garbage out.
Next time, please add the original language, the one which you are best at. Have a hard time figuring out what can possibly been written. Seems random words thrown together.
Your participation reminds me of the theme I covered in your topic on lists: polymorphism. I'll try to think about that.
idle wrote:Why did kiffi move the post to off topic [?]
I think he thought about other projects in progress so as not to scatter participation. And as I indicated that it was non-compilable, he was surprised by the "UFO" aspect of the source code! It's not a problem in the end, because it did not isolate the subject. This code is just a workshop for experienced connoisseurs: in very few lines, you can check the reactions of the compilers when you want to create a preprocess tool, in particular.
idle wrote:it's actually a good tip for those that would like to use the compiler in standby mode. Thanks for the code Olli.
Thank you a lot.
Re: StandBySystem
Posted: Fri Apr 29, 2022 5:25 am
by Rinzwind
Tip:
https://www.deepl.com/translator
But remember here too: just because it looks grammatically ok, that doesn't mean the translation is always accurate. In your case it seems you don't use any tools. You might reconsider if yo want people to understand the deep meanings of your output
