We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 786
» Latest member: WilliamVar
» Forum threads: 212
» Forum posts: 2,220

Full Statistics

Online Users
There are currently 50 online users.
» 0 Member(s) | 48 Guest(s)
Bing, Applebot

Latest Threads
New project
Forum: Discussion
Last Post: litdev
10-13-2025, 09:09 AM
» Replies: 2
» Views: 46
LDGeography.GetAllCountri...
Forum: Extensions
Last Post: litdev
10-05-2025, 12:33 PM
» Replies: 5
» Views: 190
TCP/IP Socket Programming
Forum: Extensions
Last Post: litdev
09-27-2025, 03:36 PM
» Replies: 23
» Views: 2,136
Hi everyone
Forum: Discussion
Last Post: z-s
09-25-2025, 08:14 AM
» Replies: 0
» Views: 95
Prototype for 3D Small Ba...
Forum: Discussion
Last Post: sm4llprogrammer2008
09-24-2025, 09:50 PM
» Replies: 0
» Views: 123
Really great announcement...
Forum: Discussion
Last Post: sm4llprogrammer2008
09-24-2025, 09:41 PM
» Replies: 4
» Views: 373
Challenge 14 - Rainbow
Forum: Challenges
Last Post: martmen
09-20-2025, 01:42 PM
» Replies: 5
» Views: 361
Small Basic super slow ??
Forum: Standard Small Basic
Last Post: sm4llprogrammer2008
09-14-2025, 11:07 PM
» Replies: 27
» Views: 2,981
Sudoku Solver Publishe...
Forum: Standard Small Basic
Last Post: The Old Guy
09-01-2025, 06:20 AM
» Replies: 7
» Views: 518
Challenge 13 - Search uti...
Forum: Challenges
Last Post: martmen
08-29-2025, 10:13 AM
» Replies: 8
» Views: 796

 
  Question about a program
Posted by: Eddie - 07-17-2025, 04:32 PM - Forum: Standard Small Basic - Replies (4)

Hallo, ich habe ein Programm unter der QCBN-Nummer 365.000 veröffentlicht. Das Programm soll zur Steuerung meiner Modellbahn dienen. Beim Start öffnet sich ein grafisches Fenster mit Schaltflächen und einem Gleisplan mit Linien. Alles funktioniert. Klickt man auf die grünen Kreise, bewegt sich eine Linie, die eine Weiche darstellen soll. Nun zum Problem: Stellt man die Weiche per Mausklick, ist alles in Ordnung. Der Befehl wird an die DCC-EX-Zentrale gesendet und die Weiche auf der Anlage schaltet ebenfalls. Drückt man die Schaltfläche Fahrstraße A, werden die Befehle auch korrekt gesendet. Was jedoch nicht schaltet, sind die Weichen in meinem Gleisplan. Meine Idee war, das Textfeld tb1 auszulesen. Dort wird die Rückmeldung der Zentrale angezeigt. Leider ist mir das bisher nicht gelungen. Hat jemand eine Idee?

Print this item

  TCP/IP Socket Programming
Posted by: Juergen - 07-14-2025, 08:35 AM - Forum: Extensions - Replies (23)

Hello, i want to program a TCP/IP Socket to establish an ethernet communication, just to transmit some values over ethernet.
I look for some example codes or API or libraries in litdev. 
Who can give me a hint ?

Print this item

  LDCommPort
Posted by: Eddie - 07-13-2025, 05:56 AM - Forum: Extensions - Replies (8)

Hallo zusammen, ich versuche gerade, mit SB eine Steuerung für meine Modelleisenbahn zu schreiben. Dabei bin ich auf ein Problem gestoßen, das ich nicht lösen kann. Ich habe folgenden Code zur Steuerung der Lokomotiven erstellt.

lokAdresseTB = Controls.AddTextBox(20,930)
Controls.SetTextBoxText(lokAdresseTB, "3")

lokSlider = LDControls.AddSlider(150.930.200)
LDControls.SetSliderRange(lokSlider,0,126)
LDControls.SetSliderValue(lokSlider,0)

LokVorBTN = Controls.AddButton("▶️ Vorwärts",380,930)
LokZurBTN = Controls.AddButton("◀️ Rückwärts",450,930)
LokStopBTN = Controls.AddButton("⏹️ Halt",520,930)

Sub-LokSteuerung
  adresse = Controls.GetTextBoxText(lokAdresseTB)
  geschw = LDControls.GetSliderValue(lokSlider)

  Wenn Controls.LastClickedButton = LokVorBTN, dann
    LDCommPort.TXString("<t " + adresse + geschw +"1 ">")
  EndIf

  Wenn Controls.LastClickedButton = LokZurBTN, dann
    LDCommPort.TXString("<t " + adresse + geschw + "0 ">")
  EndIf

  Wenn Controls.LastClickedButton = LokStopBTN, dann
    LDCommPort.TXString("<t " + adresse + " 1 0>")
  EndIf
EndSub

Das Problem liegt in dieser Zeile: LDCommPort.TXString("<t " + address + speed +"1 ">"). Hier behauptet SB, ich hätte drei Argumente angegeben, obwohl nur eines benötigt wird. Hat jemand eine Idee, wie man das anders schreiben könnte?
Der Befehl, der an die DCC-EX-Zentrale gesendet werden muss, sieht folgendermaßen aus: <t 3 50 1> Das t steht für die anzusprechende Lokomotive; die 3 ist die DCC-Adresse, die 50 die Geschwindigkeit und die 1 die Richtung.
Viele Grüße, Eddie

Print this item

  I finished making my web-based recreation of Small Basic for the web
Posted by: sm4llprogrammer2008 - 07-04-2025, 05:04 PM - Forum: Standard Small Basic - No Replies

And honestly, it feels like Small Basic Online but you can use it anywhere!
It'll release soon.

Print this item

  Diving into Z-S's SB.js web program
Posted by: sm4llprogrammer2008 - 06-25-2025, 01:48 PM - Forum: Standard Small Basic - Replies (2)

Z-S shared me a project while I started to create SBJS, and I think it's fast enough, very well engineered.
First I tried this:

Code:
textwindow.writeline("hello, world!");
It probably made sense to include a semicolon, because it maybe was just custom JS objects + classes running with eval() on the background.
Then went on to test some classic SB syntax:
Code:
for i=1 to 5
textwindow.write("Hello, world! ");
endfor
Surprisingly, it worked.
Then tested this:
Code:
uinput = textwindow.read();
textwindow.writeline(uinput);

Also it used the browser's native input box dialog instead of a text cursor within the console.
Then tested JS multiline notes:
Code:
/* Multiline notes
on SB.js */
It was ignored. Didn't throw any errors.
It probably supported my belief of custom JS objects + classes on the background running with eval(). Z-S is truly a web mastermind, and I appreciate that.
Anyway you can try Z-S's SB.js at https://www.zs.rf.gd/SBJS/

Print this item

  SBJS coming soon
Posted by: sm4llprogrammer2008 - 06-24-2025, 07:02 PM - Forum: Standard Small Basic - Replies (2)

I've decided to port Small Basic to JS... Literally.
I've decided to make the SB implementation of JS also more web-friendly, and also C#-like (i.e TextWindow => Console)
Imagine making websites on SB, like the old Silverlight Small Basic Player days and SBO but web-wide.

Print this item

  Google Search Terminal SB Edition v2.0_01
Posted by: sm4llprogrammer2008 - 06-24-2025, 01:27 PM - Forum: Standard Small Basic - No Replies

Hotfix for one of my longest programs ever.
Still requires SB 1.2 + LD and ZS extensions.
The fix is located on the info of the 'mnu' / ShowMenu() / Menu() invocations, where semicolons were added for added clarity (inside some help info strings not to separate SB statements).
ID: MSNS590.000
Listing: https://smallbasic.com/program/?MSNS590.000
Code is too long.

Print this item

  Google Search Terminal SB Edition v2.0
Posted by: sm4llprogrammer2008 - 06-24-2025, 12:11 AM - Forum: Standard Small Basic - Replies (1)

(NOT sVB)
Finally out!
This adds a lotta features!
Requires LD + ZS extensions. (SB 1.2 only)
ID: PXCR310.000
Listing: https://smallbasic.com/program/?PXCR310.000
Code is too long.

Print this item

  Google Search Terminal SB Edition
Posted by: sm4llprogrammer2008 - 06-23-2025, 09:47 PM - Forum: Standard Small Basic - No Replies

And I've been making it today.
It actually launches a search (via LDProcess) and also parses the query, but doesn't URL encode it.
More features might come soon (GST: SBE v2!)
ID: CVJT898.000
Program listing: https://smallbasic.com/program/?CVJT898.000

Code:
Sub PauseNoMsg
  TextWindow.WriteLine("PRESS ANY KEY TO CONTINUE ... ")
  TextWindow.PauseWithoutMessage()
EndSub
Sub SetToDefaultColor
  TextWindow.ForegroundColor = DefaultColor
EndSub
Sub Logo
  TextWindow.ForegroundColor = "Blue"
  TextWindow.Write("G")
  TextWindow.ForegroundColor = "Green"
  TextWindow.Write("O")
  TextWindow.ForegroundColor = "Red"
  TextWindow.Write("O")
  TextWindow.ForegroundColor = "Yellow"
  TextWindow.Write("G")
  TextWindow.ForegroundColor = "Blue"
  TextWindow.Write("L")
  TextWindow.ForegroundColor = "Green"
  TextWindow.Write("E")
  TextWindow.ForegroundColor = "Red"
  TextWindow.Write("!")
  SetToDefaultColor()
EndSub
Sub Search
  TextWindow.WriteLine("")
  TextWindow.Write("What'd you like to search?")
  getsearch = TextWindow.Read()
  parsedsearch = LDText.Replace(getsearch," ","+")
  LDProcess.Start("https://google.com/search?hl=en-us&udm=14&q="+parsedsearch,"")
  Search()
EndSub
TextWindow.Title = "DOSBox (MS-DOS)"
DefaultColor = TextWindow.ForegroundColor
TextWindow.Write("C:\DOS\NET\TOOLS\GOOGLE>")
totype[1] = "g"
totype[2] = "o"
totype[3] = "o"
totype[4] = "g"
totype[5] = "l"
totype[6] = "e"
totype[7] = "."
totype[8] = "c"
totype[9] = "o"
totype[10] = "m"

For i=1 To Array.GetItemCount(totype)
  TextWindow.Write(totype[i])
  Program.Delay(70)
EndFor

TextWindow.WriteLine("")
TextWindow.Title = "Google Terminal 8981"
TextWindow.ForegroundColor = "Yellow"
TextWindow.Write("WARNING: ")
TextWindow.ForegroundColor = DefaultColor
TextWindow.Write("It is recommended to run this simulation with a really fitting typeface style! Right-click the title bar, click 'Properties', go to 'Font' and scroll until you find 'Raster Fonts', then select it, then select 7x12 on the 'Size' section and click 'OK' (works best on Win10/11, might work on 8/8.1 or 7 though)")
TextWindow.WriteLine("")
PauseNoMsg()
TextWindow.WriteLine("")
TextWindow.Write("Google is starting")
For i=1 To 10
  TextWindow.Write(".")
  Program.Delay(100)
EndFor

TextWindow.WriteLine("")
For i=1 To 6
  TextWindow.WriteLine("")
EndFor

Logo()
TextWindow.WriteLine("")
Search()
PauseNoMsg()

It all started when I realized SB's conhost instance's typeface could be tweaked to feel more like DOS.
In Win10/11, first you'd Win+R, then type 'conhost', then right-click the titlebar, then click 'Properties', then go to 'Font', then scroll 3 times (w/ a mouse) until you find "Raster Fonts", then click it, and then select 7x12 from the 'Size' list, then click 'OK'.
I'm playing around with this typeface, it feels like Windows 7 when WT did not exist and console host was king!

Print this item

  LDGraphicsWindow.TransparentGW() only one
Posted by: martmen - 06-11-2025, 11:54 AM - Forum: Extensions - Replies (2)

Hello LitDev,

In the BJTN694.000 program, I am trying to create four windows. Windows 1–3 using LDGraphicsWindow.TransparentGW(), and the fourth window with LDWindows.Create().
However, only the first and last windows are being generated. Can LDGraphicsWindow.TransparentGW() only create one window at a time?
Is there anything you can change about this?

Best regards,
Martin

Print this item