ich bin Linux Neuling und habe daher folgende Frage:
Ich habe ein Mini Konsolen Programm geschrieben (Code siehe unten), wenn ich das jetzt weiter geben will an einen Rechner der kein PB installiert hat, muss ich da irgendwelche Abhängigkeiten beachten ? Immerhin muss doch einiges für die PB-Entwicklungsumgebung nachinstalliert werden. Und wie kann ich so etwas herausfinden?
Danke schonmal für die Antworten.
Code: Alles auswählen
;- LINUX console command
;- DELAY = cast a given delay in ms
;- (c) 2014 by Makke
EnableExplicit
Define.l countParams, msMulti, msDelay, n, nbOfSteps
Define.i startTime
Define.s Param
startTime = ElapsedMilliseconds()
countParams = CountProgramParameters()
If countParams = 0 Or countParams > 1
OpenConsole()
PrintN("delay - console command to wait a given time")
PrintN("")
PrintN("usage: delay [NumberOfMiliSeconds]<[s|m]>")
PrintN("example: delay 1000 - this waits 1000 miliseconds before continue")
PrintN("example: delay 1s - this waits 1 second before continue")
PrintN("example: delay 1m - this waits 1 minute before continue")
PrintN("")
PrintN("(c) 2014 by Makke, written in PureBasic")
CloseConsole()
End
EndIf
Param = ProgramParameter()
If FindString(UCase(Param), "MS")
ReplaceString(UCase(Param), "MS", "")
msMulti = 1
ElseIf FindString(UCase(Param), "S")
ReplaceString(UCase(Param), "S", "")
msMulti = 1000
ElseIf FindString(UCase(Param), "M")
ReplaceString(UCase(Param), "M", "")
msMulti = 60000
Else
ReplaceString(UCase(Param), "MS", "")
msMulti = 1
EndIf
msDelay = Val(Param) * msMulti
OpenConsole()
Print("waiting " + Str(msDelay) + " miliseconds ")
For n = 1 To msDelay
If ElapsedMilliseconds() - startTime <= msDelay
nbOfSteps + 1
If nbOfSteps = 1
Print(Chr(8) + "/")
ElseIf nbOfSteps = 2
Print(Chr(8) + "-")
ElseIf nbOfSteps = 3
Print(Chr(8) + "\")
ElseIf nbOfSteps = 4
Print(Chr(8) + "|")
ElseIf nbOfSteps = 5
Print(Chr(8) + "/")
ElseIf nbOfSteps = 6
Print(Chr(8) + "-")
ElseIf nbOfSteps = 7
Print(Chr(8) + "\")
ElseIf nbOfSteps = 8
Print(Chr(8) + "|")
nbOfSteps = 0
EndIf
Delay(1)
Else
Break
EndIf
Next
PrintN(Chr(8) + "... done !")
CloseConsole()
End