Page 1 of 1

Sub routines always present

PostPosted: Fri Jul 31, 2015 9:50 am
by stu
I don't know if anyone think this is useful or maybe there's a better way of doing this but I think It would be absolutely awesome to have the possibility of writing subroutines at any given moment, for example soon as adding a button I can type gosub "routine1" and I have possibility to add the code for the subroutine somehow... I mean, its not a big deal to just close the button properties and then F6 to the properties and land at the Actions but still sometimes (and I know it sounds stoner) I just loose track of what I was trying to do in the whole bouncing back and forth specially when there's a bunch of different interactions between the elements of a single page.

I been trying to tidy up the code into my applications and learned that its a lot easier to have it all in one place in most cases so I then organize sort of collections in the subroutine page, thats why I'm pretty much suggesting this... =)

cheers!

Re: Sub routines always present

PostPosted: Fri Jul 31, 2015 10:25 am
by Tony Kroos
Yeah subroutines should be more accessible from action editor, something like toolbar button and popup window with subs editor, and double-click on GoSub action should open subs editor as well (inside Gosub Properties dialog, or have special button (like in setvar dialog) to open multiline editor for subs).

Re: Sub routines always present

PostPosted: Fri Jul 31, 2015 10:44 am
by Neosoft Support
That's a good idea.

Re: Sub routines always present

PostPosted: Fri Jan 29, 2016 1:20 pm
by Ferdari
im with you! :P

Re: Sub routines always present

PostPosted: Sun Jan 31, 2016 8:54 am
by CN_Iceman
I like that idea too.

Re: Sub routines always present

PostPosted: Mon Mar 28, 2016 8:38 am
by dpayer
stu wrote:I don't know if anyone think this is useful or maybe there's a better way of doing this but I think It would be absolutely awesome to have the possibility of writing subroutines at any given moment,


I think something like that exists already doesn't it? Can't you CALL a function from a text file by that name in the same folder as your executable?

What would be helpful is to be able to CALL a function from a string variable (containing NB code) that could be written programmatically.

Re: Sub routines always present

PostPosted: Mon Mar 28, 2016 9:30 am
by Gaev
David Payer:

What would be helpful is to be able to CALL a function from a string variable (containing NB code) that could be written programmatically.

1) You could do something like ...
Code: Select all
SetVar "[thisFunction]" "!c:\someFolder\myFunction.txt"
FileWrite "![thisFunction]" "All" "blah, blah, blah"
Call "[thisFunction]" "param1" 'param2"


2) You could also embed Function files (generated at Design time) in your pub ... and then use ExtractFile at run time before Calling the file.