|
Post by cundo on Jun 10, 2020 22:17:53 GMT
What this tool does is to create the most simply layout for a window and copies it to the clipboard. Easy to start coding when you are using the same code over and over ie: open a window with some parameters as width and height defined.
' fast start coding v101 ' by cundo (c) 2020 ' find this code and discussion at justbasiccom.proboards.com nomainwin
WindowWidth = 384 : WindowHeight = 410 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
global radiosel$
texteditor #main.ed, 8,240,356,77 statictext #main.st1, "< Name && Handle >", 119, 18, 128, 20 textbox #main.txt1, 254, 16, 100, 25 textbox #main.txt2, 8, 16, 100, 25 button #main.button1, "Create!", dummy, ul, 6, 332, 352, 30 groupbox #main.groupbox, "Window Types", 46, 60, 264, 132 radiobutton #main.window, "Window", dummy, dummy, 54, 86, 70, 20 radiobutton #main.window_nf, "Window_nf", dummy, dummy, 54, 106, 90, 20 radiobutton #main.graphics, "Graphics", dummy, dummy, 162, 86, 80, 20 radiobutton #main.graphics_nsb, "Graphics_nsb", dummy, dummy, 162, 106, 112, 20 radiobutton #main.graphics_nsb_nf, "Graphics_nsb_nf", dummy, dummy, 162, 126, 136, 20 radiobutton #main.graphics_fs_nsb, "Graphics_fs_nsb", dummy, dummy, 162, 146, 136, 20 radiobutton #main.dialog, "Dialog", dummy, dummy, 54, 126, 64, 20 radiobutton #main.dialog_nf, "Dialog_nf", dummy, dummy, 54, 146, 88, 20 radiobutton #main.window_popup, "Popup Window", dummy, dummy, 54, 166, 119, 20 checkbox #main.r1, "Use Branches instead of Subs", dummy, dummy, 16, 208, 222, 20
open "Fast start v1.01" for dialog_nf as #main #main "trapclose quit" #main "font arial 11" #main.txt1 "#main" #main.txt2 "untiltled" call dummy "#main.window" '#main.ed "!disable" #main.r1 "set" #main.ed "!font tahoma 8" wait
sub quit h$ close #h$ end end sub
Sub dummy h$
select case case h$ = "#main.button1" #main.txt1 "!contents? txt$" #main.txt2 "!contents? theName$" cls
#main.r1 "value? result$" if result$="set" then itag$="[" otag$="]" closingCode$= "[quit]";chr$(13);_ " close ";txt$;chr$(13);_ " end" else closingCode$ = "Sub quit h$";chr$(13);_ " close #h$" ;chr$(13);_ " end";chr$(13);_ "End Sub" end if
toPrint$ = "WindowWidth = 640 : WindowHeight = 480";chr$(13);_ "UpperLeftX=int((DisplayWidth-WindowWidth)/2)";chr$(13);_ "UpperLeftY=int((DisplayHeight-WindowHeight)/2)";chr$(13);chr$(13);_ "Open ";chr$(34);theName$;chr$(34);" for ";radiosel$; " as ";txt$;chr$(13);_ " ";txt$;" "; chr$(34); "trapclose ";itag$;"quit";otag$; chr$(34);chr$(13);_ "wait";chr$(13);chr$(13);_ closingCode$
#main.ed "!cls" #main.ed toPrint$ #main.ed "!selectall" #main.ed "!copy" #main.ed "!paste" #main.ed "!origin 0 0" notice "Code copied to the clipboard!"
case instr(h$,"r1")=0 #h$ "set" radiosel$ = word$(h$,2,".")
end select
End sub
|
|
|
Post by cundo on Jun 22, 2020 22:00:22 GMT
Now with a ComboBox
' fast start coding helper v102 ' by cundo (c) 2020 ' find this code and discussion at justbasiccom.proboards.com nomainwin
WindowWidth = 384 : WindowHeight = 410 UpperLeftX= int((DisplayWidth-WindowWidth)/2) UpperLeftY= int((DisplayHeight-WindowHeight)/2)
dim ar$(19) ar$(1)= "window" ar$(2)= "window_nf" ar$(3)= "window_popup" ar$(4)= "dialog" ar$(5)= "dialog_modal" ar$(6)= "dialog_nf" ar$(7)= "dialog_popup" ar$(8)= "graphics" ar$(9)= "graphics_nsb" ar$(10)= "graphics_nsb_nf" ar$(11)= "graphics_nf" ar$(12)= "graphics_fs"
texteditor #main.ed, 8, 240, 356, 77 statictext #main.st1, "< Name && Handle >", 119, 18, 128, 20 textbox #main.txt1, 254, 16, 100, 25 textbox #main.txt2, 8, 16, 100, 25 button #main.button1, "Create!", dummy, ul, 6, 332, 352, 30 groupbox #main.groupbox, "Window Types", 46, 60, 248, 82 combobox #main.combo, ar$(, dummy,54, 86, 222, 20 checkbox #main.r1, "Use Branches instead of Subs", dummy, dummy, 16, 208, 222, 20
open "Fast start v1.01" for dialog_nf as #main #main "trapclose quit" #main "font arial 11" #main.txt1 "#main" #main.txt2 "untiltled"
'#main.ed "!disable" #main.r1 "set" #main.ed "!font tahoma 8" #main.combo "selectindex 1" wait
sub quit h$ close #h$ end end sub sub combosub
end sub
Sub dummy h$
select case case h$ = "#main.button1" #main.txt1 "!contents? txt$" #main.txt2 "!contents? theName$" #main.r1 "value? result$" if result$="set" then itag$="[" otag$="]" closingCode$= "[quit]";chr$(13);_ " close ";txt$;chr$(13);_ " end" else closingCode$ = "Sub quit h$";chr$(13);_ " close #h$" ;chr$(13);_ " end";chr$(13);_ "End Sub" end if #main.combo "selection? sel$" if instr(sel$,"popup") then includeButton$= "button ";txt$;".button1 ";chr$(34);_ "&Exit";chr$(34);", "; itag$;"quit";otag$;", ul, 1, 1, 100, 30" end if toPrint$ = "WindowWidth = 640 : WindowHeight = 480";chr$(13);_ "UpperLeftX=int((DisplayWidth-WindowWidth)/2)";chr$(13);_ "UpperLeftY=int((DisplayHeight-WindowHeight)/2)";chr$(13);chr$(13);_ includeButton$;chr$(13);chr$(13);_ "Open ";chr$(34);theName$;chr$(34);" for ";sel$; " as ";txt$;chr$(13);_ " ";txt$;" "; chr$(34); "trapclose ";itag$;"quit";otag$; chr$(34);chr$(13);_ "wait";chr$(13);chr$(13);_ closingCode$
#main.ed "!cls" #main.ed toPrint$ #main.ed "!selectall" #main.ed "!copy" #main.ed "!paste" #main.ed "!origin 0 0" notice "Code copied to the clipboard!"
end select
End sub
|
|
|
Post by Enzo on Jul 8, 2020 5:29:59 GMT
Looking for addition suggestions? I have one, just insert code lines after asking for input of relevant infomation such as string name variable array name, could have list of active variables and strings for the other parts of the code on list box and sub texteditor to preview what your adding, or maybe an active list content of all nomainwin WindowWidth = 550 WindowHeight = 410 texteditor #main.texteditor, 6, 6, 528, 350 menu #main, "Math", "rnd(", [onMathRnd], "val(", [onMathVal], "not(", [onMathNot], "sqr(", [onMathSqr] menu #main, "Strings$", "string$ = input$", [onStringsStringInput], |, "Globalize", [onStringsGlobalize], |, "Left$( Right$( Word$(", [onStringLeft], "TRIM$( MID$( CHR$(", [onStringstmc] menu #main, "Functions", "Function(", [onFunctionsFunction], "Function$(", [onFunctionsFunctionstring] menu #main, "Loops", "for next", [onLoopsForNext], "if then var = var + 1 var = x", [onLoopsIfThe], "while wend", [onLoopsWhileWend], "do while", [notice], |, "if then else", [onLoopsIfThenElse], |, "if then end if", [onLoopsIfThenEndIf] menu #main, "INPUT DATA$", "Var", [onINPUTDATAVar], "String$", [onINPUTDATAString], "array$(", [onINPUTDATAArray], "array(", [onINPUTDATAArray] menu #main, "File Operations", "open for input", [onFileOperationsOpenForInput], |, "Output", [onFileOperationsOutput], "Append", [onFileOperationsAppend] menu #main, "select case", "select case$", [fixMe] ' <-- this menu has no items! menu #main, "Edit" '<--- Texteditor Menu can be moved but not removed.
open "the menu" for window_nf as #main print #main, "trapclose [quit.main]" print #main, "font ms_sans_serif 10" wait
[quit.main] Close #main END [onMathRnd] 'Perform action for menu 'Math', item 'rnd(' 'Insert your own code here wait [onMathVal] 'Perform action for menu 'Math', item 'val(' 'Insert your own code here wait [onMathNot] 'Perform action for menu 'Math', item 'not(' 'Insert your own code here wait [onMathSqr] 'Perform action for menu 'Math', item 'sqr(' 'Insert your own code here wait [onStringsStringInput] 'Perform action for menu 'Strings$', item 'string$ = input$' 'Insert your own code here wait [onStringsGlobalize] 'Perform action for menu 'Strings$', item 'Globalize' 'Insert your own code here wait [onStringLeft] 'Perform action for menu 'Strings$', item 'Left$( Right$( Word$(' 'Insert your own code here wait [onStringstmc] 'Perform action for menu 'Strings$', item 'TRIM$( MID$( CHR$(' 'Insert your own code here wait [onFunctionsFunction] 'Perform action for menu 'Functions', item 'Function(' 'Insert your own code here wait [onFunctionsFunctionstring] 'Perform action for menu 'Functions', item 'Function$(' 'Insert your own code here wait [onLoopsForNext] 'Perform action for menu 'Loops', item 'for next' 'Insert your own code here wait [onLoopsIfThe] 'Perform action for menu 'Loops', item 'if then var = var + 1 var = x' 'Insert your own code here wait [onLoopsWhileWend] 'Perform action for menu 'Loops', item 'while wend' 'Insert your own code here wait [notice] 'Perform action for menu 'Loops', item 'do while' 'Insert your own code here wait [onLoopsIfThenElse] 'Perform action for menu 'Loops', item 'if then else' 'Insert your own code here wait [onLoopsIfThenEndIf] 'Perform action for menu 'Loops', item 'if then end if' 'Insert your own code here wait [onINPUTDATAVar] 'Perform action for menu 'INPUT DATA$', item 'Var' 'Insert your own code here wait [onINPUTDATAString] 'Perform action for menu 'INPUT DATA$', item 'String$' 'Insert your own code here wait [onINPUTDATAArray] 'Perform action for menu 'INPUT DATA$', item 'array$(' 'Insert your own code here wait [onFileOperationsOpenForInput] 'Perform action for menu 'File Operations', item 'open for input' 'Insert your own code here wait [onFileOperationsOutput] 'Perform action for menu 'File Operations', item 'Output' 'Insert your own code here wait [onFileOperationsAppend] 'Perform action for menu 'File Operations', item 'Append' 'Insert your own code here wait
|
|
|
Post by xxgeek on Feb 2, 2021 0:49:29 GMT
Hmm, I missed this thread on my tour of the forums over the last couple of months. Wish I had seen it earlier, but it is still a very good bit of code, especially for anyone new to JB.
I'll be using this at times, and I may expand on it as well.
I've had an idea mulling over in my mind, and this will be a great help to achieve it. I envision (some day) using this to write out every possible command JB has to offer, and this app to show a few variations of sample code for each command beginning with a simple example, and ending with a more advanced use of each command.
There is a lot on my plate at this time, but slowly over time this could become a godsend for new users to JB.
I know I've had a difficult time with JB code structure and syntax and I have years of experience. Someone new to coding may give up and move on to some other Basic language they find easier to use. Human nature tends to drift toward the easiest possible route, so making things easier for new users is a necessity when promoting JB.
Great job cundo!! and Enzo!!
I find it odd that there aren't more comments in this thread. But that could be because the majority of members here have the skills and don't need this sort of helper code.
Thanks for posting this. Don't stop improving this, it will help with the promotion of JB, as new more new users find it. I wish we could have access to the JB source code so we could embed code like this and other code and make JB better instead of waiting for the Developers to post updates. In the long run it would help attract more people to JB, and keep them on JB.
|
|
|
Post by Enzo on Mar 8, 2021 23:44:51 GMT
xxgeek there's been a small community here of programmers and rarely see beginners, generally people move to another language, like Liberty; which has a very strong following.
However if you have a quality code idea as you speak of, Carl had been known to include users programs in new releases incld files. I actually submitted Mayhem! back in the day. Which was completed into a LAN type two-player, it was picked because of the "neatness" of ability to read/learn from.
Each menu item could contain a window with suggestions of different types of code as in, set for next loops start stop and step, array filling with copy paste via line input, think of the older VB.net and c++ ide, even editor with predictions and right click menu although these are tricky to code in JB alone. Follow proper syntax and use another window (or same) to display noncommon commands with prompt to data fill areas.
The idea is that people have an idea of the code they want to produce this just simplifiys and speeds things up, also; more but not entirely, error proof.
|
|
|
Post by xxgeek on Mar 11, 2021 21:01:47 GMT
' fast start coding helper v102 ' by cundo (c) 2020 ' find this code and discussion at justbasiccom.proboards.com nomainwin
WindowWidth = 525 : WindowHeight = 400 UpperLeftX= int((DisplayWidth-WindowWidth)/2) UpperLeftY= int((DisplayHeight-WindowHeight)/2)
dim ar$(19) ar$(1)= "window" ar$(2)= "window_nf" ar$(3)= "window_popup" ar$(4)= "dialog" ar$(5)= "dialog_modal" ar$(6)= "dialog_nf" ar$(7)= "dialog_popup" ar$(8)= "graphics" ar$(9)= "graphics_nsb" ar$(10)= "graphics_nsb_nf" ar$(11)= "graphics_nf" ar$(12)= "graphics_fs" menu #main, "Math", "rnd(", [onMathRnd], "val(", [onMathVal], "not(", [onMathNot], "sqr(", [onMathSqr] menu #main, "Strings$", "string$ = input$", [onStringsStringInput], |, "Globalize", [onStringsGlobalize], |, "Left$( Right$( Word$(", [onStringLeft], "TRIM$( MID$( CHR$(", [onStringstmc] menu #main, "Functions", "Function(", [onFunctionsFunction], "Function$(", [onFunctionsFunctionstring]
menu #main, "Loops", "for next", [onLoopsForNext], "if then var = var + 1 var = x", [onLoopsIfThe], "while wend", [onLoopsWhileWend], "do while", [notice], |, "if then else", [onLoopsIfThenElse], |, "if then end if", [onLoopsIfThenEndIf] menu #main, "INPUT DATA$", "Var", [onINPUTDATAVar], "String$", [onINPUTDATAString], "array$(", [onINPUTDATAArray], "array(", [onINPUTDATAArray] menu #main, "File Operations", "open for input", [onFileOperationsOpenForInput], |, "Output", [onFileOperationsOutput], "Append", [onFileOperationsAppend] menu #main, "select case", "select case$", [fixMe] ' <-- this menu has no items! menu #main, "Edit" '<--- Texteditor Menu can be moved but not removed. texteditor #main.ed, 8, 120, 495, 170 statictext #main.st1, "< Name && Handle >", 185, 18, 128, 20 textbox #main.txt1, 320, 16, 100, 25 textbox #main.txt2, 80, 16, 100, 25 button #main.button1, "Generate Code", dummy, ul, 150, 300, 200, 25 'groupbox #main.groupbox, " Window Types", 125, 55, 248, 1 combobox #main.combo, ar$(, dummy, 140, 55, 222, 20 checkbox #main.r1, "Use Branches instead of Subs", dummy, dummy, 16, 90, 222, 20 'texteditor #main.texteditor, 6, 230, 490, 150
open "Fast start v1.01" for window_nf as #main #main "trapclose quit" #main "font arial 11" #main.txt1 "#main" #main.txt2 "untiltled"
'#main.ed "!disable" #main.r1 "set" #main.ed "!font tahoma 8" #main.combo "selectindex 1" wait
sub quit h$ close #h$ end end sub
sub combosub
end sub
Sub dummy h$
select case case h$ = "#main.button1" #main.txt1 "!contents? txt$" #main.txt2 "!contents? theName$" #main.r1 "value? result$" if result$="set" then itag$="[" otag$="]" closingCode$= "[quit]";chr$(13);_ " close ";txt$;chr$(13);_ " end" else closingCode$ = "Sub quit h$";chr$(13);_ " close #h$" ;chr$(13);_ " end";chr$(13);_ "End Sub" end if #main.combo "selection? sel$" if instr(sel$,"popup") then includeButton$= "button ";txt$;".button1 ";chr$(34);_ "&Exit";chr$(34);", "; itag$;"quit";otag$;", ul, 1, 1, 100, 30" end if toPrint$ = "WindowWidth = 640 : WindowHeight = 480";chr$(13);_ "UpperLeftX=int((DisplayWidth-WindowWidth)/2)";chr$(13);_ "UpperLeftY=int((DisplayHeight-WindowHeight)/2)";chr$(13);chr$(13);_ includeButton$;chr$(13);chr$(13);_ "Open ";chr$(34);theName$;chr$(34);" for ";sel$; " as ";txt$;chr$(13);_ " ";txt$;" "; chr$(34); "trapclose ";itag$;"quit";otag$; chr$(34);chr$(13);_ "wait";chr$(13);chr$(13);_ closingCode$
#main.ed "!cls" #main.ed toPrint$ #main.ed "!selectall" #main.ed "!copy" #main.ed "!paste" #main.ed "!origin 0 0" notice "Code copied to the clipboard!"
end select
End sub
[quit.main] Close #main END [onMathRnd] 'Perform action for menu 'Math', item 'rnd(' 'Insert your own code here wait [onMathVal] 'Perform action for menu 'Math', item 'val(' 'Insert your own code here wait [onMathNot] 'Perform action for menu 'Math', item 'not(' 'Insert your own code here wait [onMathSqr] 'Perform action for menu 'Math', item 'sqr(' 'Insert your own code here wait [onStringsStringInput] 'Perform action for menu 'Strings$', item 'string$ = input$' 'Insert your own code here wait [onStringsGlobalize] 'Perform action for menu 'Strings$', item 'Globalize' 'Insert your own code here wait [onStringLeft] 'Perform action for menu 'Strings$', item 'Left$( Right$( Word$(' 'Insert your own code here wait [onStringstmc] 'Perform action for menu 'Strings$', item 'TRIM$( MID$( CHR$(' 'Insert your own code here wait [onFunctionsFunction] 'Perform action for menu 'Functions', item 'Function(' 'Insert your own code here wait [onFunctionsFunctionstring] 'Perform action for menu 'Functions', item 'Function$(' 'Insert your own code here wait [onLoopsForNext] 'Perform action for menu 'Loops', item 'for next' 'Insert your own code here wait [onLoopsIfThe] 'Perform action for menu 'Loops', item 'if then var = var + 1 var = x' 'Insert your own code here wait [onLoopsWhileWend] 'Perform action for menu 'Loops', item 'while wend' 'Insert your own code here wait [notice] 'Perform action for menu 'Loops', item 'do while' 'Insert your own code here wait [onLoopsIfThenElse] 'Perform action for menu 'Loops', item 'if then else' 'Insert your own code here wait [onLoopsIfThenEndIf] 'Perform action for menu 'Loops', item 'if then end if' 'Insert your own code here wait [onINPUTDATAVar] 'Perform action for menu 'INPUT DATA$', item 'Var' 'Insert your own code here wait [onINPUTDATAString] 'Perform action for menu 'INPUT DATA$', item 'String$' 'Insert your own code here wait [onINPUTDATAArray] 'Perform action for menu 'INPUT DATA$', item 'array$(' 'Insert your own code here wait [onFileOperationsOpenForInput] 'Perform action for menu 'File Operations', item 'open for input' 'Insert your own code here wait [onFileOperationsOutput] 'Perform action for menu 'File Operations', item 'Output' 'Insert your own code here wait [onFileOperationsAppend] 'Perform action for menu 'File Operations', item 'Append' 'Insert your own code here wait
Oh for crying out loud, I wiped out most of my post trying edit it. Basically what I said earlier was I would be interested in helping out with this. If 3 or 4 of us worked together on it we could make good progress too. The code above is just a melding of what you and cundo have here already. I needed a break from my own project so I played with this one to get to know it better. Good idea though, and I'm in if you guys are. maybe a couple more would like to join in as well. The picture link below is a picture of my setup for coding JB basic. I use your JBsearch (edittted) along with a freeware offline html viewer. The httml viewer can be resized, and remembers it's size on restart. I keep both apps slimmed down and on each side of JB IDE. Your search engine was instrumental in learning JB code for me. Very fast with the offline html edittor, and right there in front of me as I code. I intend to, with your permission of course, to add it to the Project Organizer Ive been working on, either just adding the code to mine, or start using a folder to add the html viewer and more apps to the Organizer. Let me know if you're against the idea ok? BTW - Any, and ALL code I post is Public domain, I don't care who uses it, or what they do with it, just don't want to see anyone claiming it is their work is all. And any credit given to me is to xxgeek @ justbasiccom.proboards.com, not my real name. That's all I ask. This what I use to get quick help while coding. You would need to download the png file to see the real picture. Link to Picture of JBSearch used with JB IDE and OffLine htmlViewer
|
|
|
Post by Enzo on Mar 12, 2021 0:43:50 GMT
An idea is to add the most information/code completed with menus in new windows, combobox is a very good idea
A separate one for adding information for renaming or editing via variable, keep in mind each variable call out would new in a new window from clicking selection$, a simple search word$ parse for length (variable len) and a edit function of word$(string$,len),
An easier prediction is the first three characters of each command have it reload your code with the finished command.
Keep track of last three alphabet characters after a [spacebar] usage, cls, input display, and/or have option to click ALT key once three or more characters are typed and finishes command and brings up menu for completing information when applicable.
I'd be willing to work on this with others working on as well, I'd like another JB package release to include something like this.
Use a "A" character in front of any commands strings to avoid locking up the compile, sometimes JB reads this data...
|
|
|
Post by xxgeek on Mar 12, 2021 17:41:49 GMT
Since both you Enzo and cundo are leaps ahead of me in coding JB, how about making an example of one of the commands for me to work with so we're all on the same page.
I've never worked with others doing something like this and don't want to go off on a tangent to find out later I'm doing things all wrong. I'm not an expert coder by any means, always around the beginner to intermediate level. Never taken any courses in programming or computers for that matter. A total hack is what I am. I have always been able to read and understand (eventually) what others have written. I learn by example. There are still many commands I haven't used, or even looked into so far. If you've been keeping an eye on my progress with the Project Organizer you'll notice as time goes by and I learn more the app gets better with new features and ways of doing things in the code. The code itself I have tried to keep it simple, step by step with documentation so someone new to JB can easily learn from it. That would be, or is, my mission, to help the new guys learn the JB way.
For now anyway, I think my role would be best suited for doing the legwork of using examples you guys create. If I had an example code/window of what is expected by clicking on a command link for a command like say - while/wend I could use that to go through commands I am familiar with to reproduce the same type code/window for them. As I learn more myself and get more fluid with coding I could add more info to each. Going from a simple example of using each command to a more advanced level. Examples, to me anyway, are the best learning tools.
For example, last night I used freeform to produce all the code for each function freeform has to offer, but couldn't get some of them to work for me. I need to see an example of how someone else used them and I'll be off running.
Think about this and see what you guys can come up with to get us all started. Documenting helps too. Saves time if each block off code has been documented, and each variable used is explained, and named appropriate to it's use in the code. If I find any undocumented variables or code blocks and I understand them regardless, I will add the documentation myself.
|
|
|
Post by Enzo on Mar 13, 2021 1:01:52 GMT
Keep track of last three alphabet characters after a [spacebar] usage, cls, input display, and/or have option to click ALT key once three or more characters are typed and finishes command and brings up menu for completing information when applicable.
Use graphic box for input console use password example for information, i.e. line input inkey$, any space key pressed
before following code ; if inkey$=space or a-z 0-9 then [updatebothdisplays]
Enter key for new line input
use
commandarray$(1)="ope" 'open command newcommandarray$(1)="open"
[updatebothdisplays] string$ = string$ + inkeyparse() stringtxt$=stringtxt$+inkeyparse$ #m.g, "/";string$ 'displays default font text as string$ on graphic box #m.t, stringtxt$
[branchcallout] if inkey$ = chr$(ALT for clear = 1 to 3 string$=string$+array$(clear) array$(clear)="" next clear else n=n+1 array$(n)=inkey$ end if
return 'from gosub [branchcallout]
[parse] for n = 1 to 3 if string$=commandarray$(n) then stringtxt$ = stringtxt$+newcommandarray$(n) next n
|
|
|
Post by Enzo on Mar 13, 2021 2:33:44 GMT
Most of program is written above, new windows with forums could simply be blank code format witb txt boxes to temp fill edit in texteditor on new window and add to program.
Only issue I see is keeping track of line number, maybe a character added where the line would be inputted such as { which on combo box or menu would open new window to delete { and input new code.
I believe a new line is as simple as m.t, "" and word$ mid$ left$ right$ functions with beginingcode$ and endcode$, inputcode$ string variables from left$( and right$( functions with new lines and viola, you've got a simple IDE with the other programs you've posted xxgeek.
If you run into trouble with line inputs use array (as in not starting on new line) for new windowed code, space out each line, these can be deleted after.
Tabbed editors for branches and functions; use begin/end$ in array instead.
Sorry cundo for overtaking your idea you always have very useful code!
|
|
|
Post by xxgeek on Mar 13, 2021 23:37:48 GMT
Enzo, I get a syntax error on line string$ = string$ + inkeyparse() Code won't run. I made a fix, then got another syntax error and said " " Never mind what I said lol
I think we should wait till we hear from cundo anyway, since it is his code, and his idea. After thinking it over, I don't think I would appreciate someone taking over my projects, unless of course I was done with them. See what cundo has to say first.
btw - I'm stll waiting for an answer from cundo about using his jbhelp search program in the program I'm working on. That search program is a great help to me while learning jb code.
|
|
|
Post by Enzo on Mar 13, 2021 23:55:44 GMT
That code was part pseudo, inkey needs to equal another variable first In$ for example and ALT space and enter all need manual mapping. Search _VK_ALT
I had direction to make something like this, where the idea came from for searching command predictions, menuized commands and windowed data fill isn't anything new to programming VB.net offer(ed) the same thing back in the day.
You may use the code I posted.
|
|
|
Post by Enzo on Mar 29, 2021 20:48:22 GMT
Another way is to use comboboxes as the editor, one line per entry, when clicked brings up one of two forums, edit existing format or a single wizard page to add the data formatted. Allows for scrolling, no misclick/deletes, ability to easily save line and back up as a master edit file of changes such as apple inc. "time machine", make an entry file of changes LINE#### COMMANDDATA You can insert lines with a click of a button, with Rightclick a menu can be brought up aswell. I feel this is more your route, it has not been done before as far as I've seen and techincally you could have different windows of for functions, branches, info docs A universal parse for finding variables and strings is easy, bascially detemine word$ is not JB command, doesnt end in ) and either has a "$" string character at the end makes it a variable defer the latter you have a string, while ending in ) is a function or array, searching for function in word$ type method to compare ) word$ with all if true then you got youself a function, false it's an array numberical or data$()
|
|
|
Post by Enzo on Mar 29, 2021 21:10:06 GMT
filedialog "bas", "*.bas", file$ dim array$(1000) nomainwin
WindowWidth = 544 WindowHeight = 375
UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
listbox #m.l, array$(, [click], 6, 11, 488, 280 open "test listbox" for dialog_nf as #m print #m, "trapclose [quit.m]" print #m.l, "singleclickselect" print #m, "font ms_sans_serif 10"
if file$="" then end dim program$(3000) open file$ for input as #file while not(eof(#file)) line input #file, program$(i) i=i+1 wend close #file
for x = 1 to i
array$(x) = program$(x)
next x
'display [reload] print #m.l, "reload"
[main]
wait
[click] print #m.l, "selectionindex? index"
prompt "{Code; \"; newcode$
array$(index) = newcode$ goto [reload]
[quit.m] close #m end
Have textbox update to fill line from LISTbox, and when key is pressed to enter data have it check if string was altered then update array$()
|
|
|
Post by Enzo on Mar 31, 2021 2:59:01 GMT
filedialog "bas", "*.bas", file$ filemax = 5000 'max number of lines of working program dim array$(filemax) nomainwin
WindowWidth = 544 WindowHeight = 375
UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
listbox #m.l, array$(, [click], 6, 11, 488, 280 listbox #m.l2, array$(, [click], 6, 11, 488, 280 open "ListBoxIDE" for dialog_nf as #m print #m, "trapclose [quit.m]" print #m.l, "singleclickselect" print #m, "font ms_sans_serif 19"
if file$="" then notice "No file!" goto [quit.m] end if dim program$(filemax) open file$ for input as #file while not(eof(#file)) line input #file, program$(i) i=i+1 wend close #file
for x = 1 to i
array$(x) = program$(x)
next x
'display [reload] if toggle = 0 then
print #m.l, "hide" print #m.l2, "show" print #m.l2, "reload"
else
print #m.l, "show" print #m.l2, "hide" print #m.l, "reload" rint #m.l, "selectionindex? index" wait
[click] if toggle = 0 then print #m.l2, "selectionindex? index" else print #m.l, "selectionindex? index" end if string$ = array$(index) newcode$ = string$ prompt string$; newcode$ if newcode$ = "" then [reload] array$(index) = newcode$ index = 0 newcode$ = "" goto [reload]
[quit.m] close #m end
This verison has an 'editable' type input, allowing for a "mouse scroll" between inputs, and needs double click toggled to single; every other input.
|
|