StandBySystem

For everything that's not in any way related to PureBasic. General chat etc...
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

StandBySystem

Post 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)
User avatar
Keya
Addict
Addict
Posts: 1891
Joined: Thu Jun 04, 2015 7:10 am

Re: StandBySystem

Post 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
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: StandBySystem

Post 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)
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: StandBySystem

Post 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?
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: StandBySystem

Post 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 ?
User avatar
HeX0R
Addict
Addict
Posts: 979
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: StandBySystem

Post 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!
User avatar
ar-s
Enthusiast
Enthusiast
Posts: 340
Joined: Sat Oct 06, 2007 11:20 pm
Location: France

Re: StandBySystem

Post by ar-s »

Press Enter the type for example : FUNCTIONLIST
~Ar-S~
My Image Hoster for PB users
My webSite (french) with PB apps : LDVMULTIMEDIA
PB - 3.x / 5.7x / 6 - W11 x64 - Ryzen 7 3700x / #Rpi4

Code: Select all

r3p347 : 7ry : un71l d0n3 = 1
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: StandBySystem

Post by Marc56us »

Be curious, open the file: #PB_Compiler_Home + "SDK/CompilerInterface.txt"
Read, then look at the code, you will understand :wink:

"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
[...]"
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: StandBySystem

Post 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 !
User avatar
Keya
Addict
Addict
Posts: 1891
Joined: Thu Jun 04, 2015 7:10 am

Re: StandBySystem

Post by Keya »

Olli thanks for not taking offense to my comment, I was having a bad day (not an excuse!)
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: StandBySystem

Post 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.
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: StandBySystem

Post 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.
User avatar
idle
Always Here
Always Here
Posts: 5043
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: StandBySystem

Post 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.
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: StandBySystem

Post 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.
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: StandBySystem

Post 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 :twisted:
Post Reply