none
is it posible to execute files as batch file from small basic? RRS feed

  • Question

  • is there any way to call a batch file from small basic i have in a folder so it runs?
    Saturday, October 27, 2018 11:37 AM

Answers

  • Use LDProcess.Start

    Jan [ WhTurner ] The Netherlands

    • Marked as answer by antonio glez Saturday, October 27, 2018 12:17 PM
    Saturday, October 27, 2018 12:05 PM
    Answerer
  • Hi There!

    To run a batch file using Small Basic, You need the LitDev extension.

    Then, You can run batch files(You can run even *.exe file). Use the LDProcess.Start(file,arguments)

    LDProcess.Start(file,arguments)

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    • Marked as answer by antonio glez Saturday, October 27, 2018 12:17 PM
    Saturday, October 27, 2018 12:08 PM
  • oh great thanks a lot then i think im gonna be able to mix small basic with batch, assembly, and 8086 machine code and build a small basic program to which you give an input and output and it renders a program that with that input produces that output,  something like the chicken and egg in reverse :)

    Hi,

    I sincerely appreciate your project. LDProcess.Start() command lets you to run the batch file with specific arguments. You can also Small Basic codes using batch or cmd (Command Prompt). For example, If a small basic code is there inside C:\temp,

    You can compile it by saving the code down below as .bat or .cmd file and just double-click on it or by opening CMD and typing the code down below on it.

    CMD Code

    cd C:\temp
    
    "C:\Program Files (x86)\Microsoft\Small Basic\SmallBasicCompiler.exe" test.sb

     Thanks.

    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#


    • Edited by [Roshan_Kumar] Saturday, October 27, 2018 12:43 PM EDIT
    • Marked as answer by antonio glez Saturday, October 27, 2018 1:34 PM
    Saturday, October 27, 2018 12:41 PM
  • you can't goto into or out of a subroutine - this would corrupt the call stack.
    • Marked as answer by antonio glez Monday, October 29, 2018 12:59 AM
    Sunday, October 28, 2018 6:07 PM
    Moderator

All replies

  • Use LDProcess.Start

    Jan [ WhTurner ] The Netherlands

    • Marked as answer by antonio glez Saturday, October 27, 2018 12:17 PM
    Saturday, October 27, 2018 12:05 PM
    Answerer
  • Hi There!

    To run a batch file using Small Basic, You need the LitDev extension.

    Then, You can run batch files(You can run even *.exe file). Use the LDProcess.Start(file,arguments)

    LDProcess.Start(file,arguments)

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    • Marked as answer by antonio glez Saturday, October 27, 2018 12:17 PM
    Saturday, October 27, 2018 12:08 PM
  • oh great thanks a lot then i think im gonna be able to mix small basic with batch, assembly, and 8086 machine code and build a small basic program to which you give an input and output and it renders a program that with that input produces that output,  something like the chicken and egg in reverse :)
    Saturday, October 27, 2018 12:16 PM
  • oh great thanks a lot then i think im gonna be able to mix small basic with batch, assembly, and 8086 machine code and build a small basic program to which you give an input and output and it renders a program that with that input produces that output,  something like the chicken and egg in reverse :)

    Hi,

    I sincerely appreciate your project. LDProcess.Start() command lets you to run the batch file with specific arguments. You can also Small Basic codes using batch or cmd (Command Prompt). For example, If a small basic code is there inside C:\temp,

    You can compile it by saving the code down below as .bat or .cmd file and just double-click on it or by opening CMD and typing the code down below on it.

    CMD Code

    cd C:\temp
    
    "C:\Program Files (x86)\Microsoft\Small Basic\SmallBasicCompiler.exe" test.sb

     Thanks.

    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#


    • Edited by [Roshan_Kumar] Saturday, October 27, 2018 12:43 PM EDIT
    • Marked as answer by antonio glez Saturday, October 27, 2018 1:34 PM
    Saturday, October 27, 2018 12:41 PM
  • i guess small basic doesnt give you acces to the ram as the old zx spectrum basic did right?

    its a pity for that would easy a lot to render my ideas

    in small basic when you say a=math.getrandomnumber(8) it can be any number from 8, actually an arbitrary one

    but what i intend to do is make a quamtum emulation so when i say a= true quantically random(8)

    the idea is to run 8 simultaneous programs each one with each 8 values

    a true quamtum computer wouldnt find any different result it just would make it faster

    though my theory is that true quamtumness doesnt really exist, i think is a question of eternal recurrence with minor changes in each recurrence

    after all the algoryth a=a+1 contains all info of the universe andd all posible quamtum superposition,in one number the cat is alive some numbers later he is dead, not only that contains itself, an infinity that contains itself infinitely and all in 5 symbols a=a+1

    edit:

    i think you could emulate a true quamtum random number in samll basic but the problem its quamtum commands and why i need acces to the ram that so far only found in assembler, for example a quamtum command would be :

    if bob=0 goto in superposition with if bob<>0 goto

    so the idea is to run two program simultaneously each with each different command to later set non quamtum commands and go again a single way

    so my plan is to run a million lines one of the programs with one command each line calling to mananager subroutine that will make sure after 1 million lines run the quamtum command is substituted for the the other to run one million lines more

    then i just set a non quamtum condition for the output of both programs like tell me what of the programs was the one which produced an output of 36 :) which would recover the flow of the bifurcated program and stop




    edit:

    i hope to inspire someone, as i said you can emulate quamtumness with numbers in small basic just with a for but i would love to have more flexibility and be able to use commands as variables so the program can be selfwritable and fully quamtum able

    for example you could do ten nested for like this:

    push 1

    push 1

    for line1=comand1 to command18

    for line2=comand1 to command 18

    for line3=comand1 to command18

    for line4=comand1 to command 18

    ...

    for line10=comand1 to command18

    i=0

    line1

    manager()

    line2

    manager()

    line3

    manager()

    ...

    line10

    manager()

    pop if=2

    pop if=3

    pop if=5

    pop if=8

    textwindow.write("this is the program that produces the fibonnaci sequence"+line1+line2+...+line10)

    goto end

    push

    endif

    push

    endif

    push

    endif

    push

    endif

    endfor

    endfor

    ...

    endfor

    end:

    sub manager

    i=i+1

    if i=1000000 then

    break from for

    endsub

    and this loop would render all posible programs of 10 lines till it renders fibonacci




    Sunday, October 28, 2018 10:26 AM
  • thinking twice about i just realize that samll basic is so powerfull i can do what i will:

    basically i just have to use subroutines as this:

    sub command1

    bob=bob+alice

    ret

    sub command2

    stack.push(bob,stack)

    endsub

    sub comand 3

    ...

    and then just make nested for in which i loop thurhg the subroutines

    right now im on building purely on small basic a program that asks you for input and output and renders the program that with that input produces that output

    Sunday, October 28, 2018 4:36 PM
  • well unfortunately ive just found an obstacle though theres a long way around but why doesnt this program work

    what would be the easiest way to rewrite it so it works?

    Goto skip
    re:
    TextWindow.WriteLine("bingo")
    skip:
    testing()
    Sub testing
      Goto re
    EndSub

    Sunday, October 28, 2018 5:52 PM
  • you can't goto into or out of a subroutine - this would corrupt the call stack.
    • Marked as answer by antonio glez Monday, October 29, 2018 12:59 AM
    Sunday, October 28, 2018 6:07 PM
    Moderator
  • here my reverse chicken and egg quamtum emulation  program

    you give at as input for example 0,1 and as aoutput 1,2,3,5,8,13 and it produces youa program that with that input produces that output

    now ill try to do it in assembler to get more speed, it just can handle in small basic six line and 8 commands but if you could make it long enough maybe this way you could break patterns as the prime numbers pattern :)

    ZKD395


    Monday, October 29, 2018 11:38 AM