? HTMLBASIC ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

HTMLBASIC

Submitted
Updated
Author
Trinitro21
Public Key
D3EQ43R4
Min. Compat.
All
Size
28.4 KB
Rating
6 votes
Description A primitive version of HTML and CSS for SmileBASIC using user-defined functions. Instructions '--------- 'HTMLBASIC '--------- 'I WANTED TO MAKE AN HTML THING IN SMILEBASIC 'IT'S A BIT DIFFERENT FROM NORMAL HTML 'AND VERY PRIMITIVE 'UDFs CAN'T HAVE ANGLE BRACKETS 'TO USE, TYPE THIS INTO YOUR PROGRAM: 'SYSBEEP=0 'LOAD"PRG1:HTMLBASIC",FALSE 'USE 1 'EXEC 1 'SYSBEEP=1 'TAGS AVAILABLE: 'HTML 'STARTS THE DOCUMENT 'EHTML 'ENDS THE DOCUMENT 'HEAD 'STARTS THE HEAD 'EHEAD 'ENDS THE HEAD 'TITLE STRING$ 'GIVES THE DOCUMENT A TITLE ON THE TOP SCREEN 'CAN ONLY BE USED IN THE HEAD 'BODY 'STARTS THE BODY 'EBODY 'ENDS THE BODY 'DOESN'T ACTUALLY DO ANYTHING REALLY 'P STRING$ 'PARAGRAPH ELEMENT 'IINPUT LENGTH 'TEXT BOX 'COULDN'T USE "INPUT" BECAUSE THAT'S ALREADY A COMMAND 'LENGTH IS THE MAX LENGTH OF THE STRING IN THE TEXT BOX 'STYLE STRING$ 'ADDS CSS TO THE PREVIOUSLY DEFINED ELEMENT 'CSS: 'JUST LIKE NORMAL CSS BUT LIMITED NUMBER 'OF ATTRIBUTES AVAILABLE AND A BIT STRICT 'IN THE ORDER OF ATTRIBUTES 'WIDTH 'ALTERS THE WIDTH OF THE ELEMENT 'NUMBER IS IN TEXT SPACES, SO 1=8PX 'CAN ONLY INCREASE THE WIDTH 'HEIGHT 'ALTERS THE HEIGHT OF THE ELEMENT 'NUMBER IS IN TEXT SPACES, SO 1=8PX 'CAN ONLY INCREASE THE HEIGHT 'ALIGN 'ALIGNS THE ELEMENT 'CAN BE EITHER LEFT,RIGHT, OR CENTER 'IF LEFT OUT, THE ELEMENT WILL BE LEFT-ALIGNED 'MUST BE AFTER WIDTH AND HEIGHT 'COLOR 'CHANGES THE TEXT COLOR '0-15 'YOU CAN ALSO USE THE TEXT COLOR CONSTANTS 'LIKE #TBLACK 'BACKGROUND-COLOR 'SETS THE BACKGROUND COLOR OF THE EELEMENT 'MUST BE AFTER WIDTH, HEIGHT, AND ALIGN 'FORMATS: '#FFFFFF '>6-DIGIT HEX VALUE AFTER # '#FFF '>3-DIGIT HEX VALUE AFTER # 'RGB(255,255,255) '>SAME AS SMILEBASIC 'YOU CAN ALSO USE THE COLOR CONSTANTS 'LIKE #BLACK 'BORDER-COLOR 'SETS THE COLOR OF THE BORDER 'MUST BE AFTER WIDTH, HEIGHT, AND ALIGN 'SAME FORMATS AS BACKGROUND-COLOR 'BORDER-TOP 'BORDER-BOTTOM 'BORDER-LEFT 'BORDER-RIGHT 'SETS THE COLOR OF A SIDE OF THE BORDER 'MUST BE AFTER WIDTH, HEIGHT, AND ALIGN 'SAME FORMATS AS BACKGROUND-COLOR 'ONCLICK 'FUNCTION TO EXECUTE WHEN ELEMENT IS CLICKED 'THE FUNCTION CAN'T HAVE ANY PARAMETERS 'ONLOAD 'FUNCTION TO EXECUTE WHEN PAGE IS DONE LOADING 'THE FUNCTION CAN'T HAVE ANY PARAMETERS 'JAVASCRIPTY FUNCTIONS 'MEANT TO JUST BE SUPPLEMENTS TO BASIC FOR 'INTERFACING WITH HTMLBASIC 'LINK LABELNAME$ 'GOES TO THE SPECIFIED LABEL 'MUST HAVE THE SLOT NUMBER OF THE LABEL, LIKE 'LINK "0:@LABEL" 'IF SLOT NUMBER IS LEFT OUT, 'SLOT 0 IS ASSUMED 'CONSOLELOG STRING$ 'WRITES TO THE CONSOLE 'THE CONSOLE IS ON THE TOP SCREEN 'CONSOLECLEAR 'CLEARS THE CONSOLE
Categories
Keywords
7 Comment(s) Ptcguy Ptcguy First Week Joined in the very first week of SmileBASIC Source Website Minecraft Is Awesome! I love Minecraft! Express Yourself Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Petitworld includes something similar: PTML Trinitro21 Trinitro21 First Week Joined in the very first week of SmileBASIC Source Website Query Denied Hidden Easter Eggs Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Yeah, I saw that. It looked pretty interesting. MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Second Year My account is over 2 years old Website osu! Is Awesome! I love osu! Express Yourself Centering would be a good idea. For the math, do something like XLOC%=(25-(LEN(STRING$)/2)) MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Second Year My account is over 2 years old Website osu! Is Awesome! I love osu! Express Yourself Oh, and for JavaScript, you could use a few commands like console.log("Hello, world!") is PRINT "Hello, world!" Trinitro21 Trinitro21 First Week Joined in the very first week of SmileBASIC Source Website Query Denied Hidden Easter Eggs Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I'll add it to the list. RNGesus RNGesus Wow, it looks like you took my idea and put it to action. Nice job! blizord blizord Cool.