Jump to content











Photo
- - - - -

API functions inside WB's Magic Wand


  • Please log in to reply
68 replies to this topic

#1 billonious

billonious

    Silver Member

  • .script developer
  • 528 posts
  • Location:greezeland
  • Interests:curiosity

Posted 14 January 2009 - 07:49 PM

Hey,
I think it is time to include the command require_file, in the new api.

#2 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 14 January 2009 - 07:54 PM

I think it is time to include the command require_file, in the new api.

Seeee me confuuuused!

I think that we have it since Ice-Age!

Peter

@fxscrpt:

Maybe I misunderstood the last posts, including your intention.

If yes, can you explain again for a fool?

#3 billonious

billonious

    Silver Member

  • .script developer
  • 528 posts
  • Location:greezeland
  • Interests:curiosity

Posted 14 January 2009 - 09:40 PM

Maybe I misunderstood the last posts, including your intention.

If yes, can you explain again for a fool?

wrong phrases in a rush. I misunderstood myself. Freudic confusion.
I was to mean that I wanted to say that.... require_file be included in magic wand ... and you are right it is found in api from the times of old testament. :) I Shake my brain to turn it on...

#4 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 January 2009 - 09:56 PM

Hmm.. this a feature discussion that probably deserved a topic of it's own to allow exploring all possibilities.

Hope you don't mind that I split this from the original topic to it's own topic.

-----------

Regarding your idea, I also agree that the most common api commands should be available to the developer with the same ease as the "raw" commands.

Please suggest all the API commands that should be listed, thank you!

:)

#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 14 January 2009 - 10:26 PM

Hmm.. this a feature discussion that probably deserved a topic of it's own to allow exploring all possibilities.

Hope you don't mind that I split this from the original topic to it's own topic.

-----------

Regarding your idea, I also agree that the most common api commands should be available to the developer with the same ease as the "raw" commands.

Please suggest all the API commands that should be listed, thank you!

:)

It is difficult to implement.

Either there can be a hardcoded list inside WB. But whenever something changes, that demands a new WinBuilder.exe
Or WB could look into project.script. But that demands the API shortcut to be 'findable'. They cannot be find if they are anywhere inside the [Variables] section. Therefore they should be in a specific [API] or [?????] section.

This would demand a bigger rebuild in WB [exe] internals.

Peter

#6 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 14 January 2009 - 11:53 PM

It is difficult to implement.

Either there can be a hardcoded list inside WB. But whenever something changes, that demands a new WinBuilder.exe
Or WB could look into project.script. But that demands the API shortcut to be 'findable'. They cannot be find if they are anywhere inside the [Variables] section. Therefore they should be in a specific [API] or [?????] section.

This would demand a bigger rebuild in WB [exe] internals.

Peter

Peter,
Make the command AddVariables the possibility to set variable Global (like the Set command)
In Api I add a section [ApiVar] which contain all api command

In Script.project delete all api command from section [Variables]
and add in section [Process] in Script.project
[Process] 

AddVariables,%API%,ApiVar,GLOBAL
In api.script
[ApiVar]

Add_Shortcut=Run,%API%,AddShortcut

Require_File=run,%API%,Expand_file

Unpack=Run,%API%,Depack

_Calculate=run,%API%,Calculate
Then all api command can be found directly in the api
When updating api no need to update script.project

I don't know if this can be possible and if help you

Pedro

#7 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 January 2009 - 07:45 AM

Peter,
Make the command AddVariables the possibility to set variable Global (like the Set command)
In Api I add a section [ApiVar] which contain all api command

In Script.project delete all api command from section [Variables]
and add in section [Process] in Script.project

[Process] 

 AddVariables,%API%,ApiVar,GLOBAL
In api.script
[ApiVar]

 Add_Shortcut=Run,%API%,AddShortcut

 Require_File=run,%API%,Expand_file

 Unpack=Run,%API%,Depack

 _Calculate=run,%API%,Calculate
Then all api command can be found directly in the api
When updating api no need to update script.project

I don't know if this can be possible and if help you

Pedro

A very good idea! :)

Peter

#8 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 January 2009 - 12:22 PM

Peter,
Make the command AddVariables the possibility to set variable Global (like the Set command)
In Api I add a section [ApiVar] which contain all api command

In Script.project delete all api command from section [Variables]
and add in section [Process] in Script.project

[Process] 

   AddVariables,%API%,ApiVar,GLOBAL
In api.script
[ApiVar]

   Add_Shortcut=Run,%API%,AddShortcut

   Require_File=run,%API%,Expand_file

   Unpack=Run,%API%,Depack

   _Calculate=run,%API%,Calculate
Then all api command can be found directly in the api
When updating api no need to update script.project

I don't know if this can be possible and if help you

Pedro

I realized it.

Will be available next beta (or inofficially beta 6 a)

Please be sure to use PERMANENT rather than GLOBAL.
from release notes:

****************
added - GLOBAL and PERMANENT options to AddVariables command

AddVariables,%ScriptFile%,section,GLOBAL: Additional new variables list will be defined in all subsequent scripts of the current build.

AddVariables,%ScriptFile%,section,PERMANENT: Additional new variables list will be defined in all subsequent scripts of the current build.
- Additionally all added variables are written into script.project and therefore valid for all subsequent builds.


With GLOBAL the definitions are valid for a complete build, but not when running a single script.

Peter

#9 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 15 January 2009 - 04:47 PM

Great Peter
I will test but my idea is not to use the PERMANENT definition or why changing as it is now

I search a simply way for having a quick find of all api function and syntax
[Api_Command]

   Add_Shortcut=Run,%API%,AddShortcut

   Require_File=run,%API%,Expand_file

   Unpack=Run,%API%,Depack

   _Calculate=run,%API%,Calculate



[Api_Syntax]

   Add_Shortcut,<Type>,<Folder>,<FullFileName>,<Title>,<Work Folder>,<Parameters>,<IconFile>,<StartMode>,<ToolTip>

   Require_File , <Folder\> filename , <Source> , <Target>

   Unpack,<Folder>,<Archive>,<Option>,<%Target_Prog%>,<%ProgramFolder%>,<%programExe%>,<Target_Temp>

   _Calculate,expression,Variable
So with api formatted like this you can make WB easy to list all api function (without knowing them and only for the current project) and their respective Syntax in Api_Syntax section
Hope you understand what I mean

Pedro

#10 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 January 2009 - 04:55 PM

Great Peter
I will test but my idea is not to use the PERMANENT definition or why changing as it is now

I search a simply way for having a quick find of all api function and syntax

&#91;Api_Command&#93;

	Add_Shortcut=Run,%API%,AddShortcut

	Require_File=run,%API%,Expand_file

	Unpack=Run,%API%,Depack

	_Calculate=run,%API%,Calculate

 

 &#91;Api_Syntax&#93;

	Add_Shortcut,<Type>,<Folder>,<FullFileName>,<Title>,<Work Folder>,<Parameters>,<IconFile>,<StartMode>,<ToolTip>

	Require_File , <Folder\> filename , <Source> , <Target>

	Unpack,<Folder>,<Archive>,<Option>,<%Target_Prog%>,<%ProgramFolder%>,<%programExe%>,<Target_Temp>

	_Calculate,expression,Variable
So with api formatted like this you can make WB easy to list all api function (without knowing them and only for the current project) and their respective Syntax in Api_Syntax section
Hope you understand what I mean

Pedro


API is your playground :)
And you mean that WB is mine and I can now add to the magic wand !?

I'll see what I can do

Peter :)

#11 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 15 January 2009 - 05:01 PM

API is your playground :)
And you mean that WB is mine and I can now add to the magic wand !?

I'll see what I can do

Peter :)

Yes :)
Simply tell me how to format the section Api_Syntax

Pedro

#12 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 January 2009 - 05:07 PM

Yes :)
Simply tell me how to format the section Api_Syntax

Pedro

Tomorrow.

I have to go now for 'Nuhr die Wahrheit' (you know the famous German artist?)

Peter

#13 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 15 January 2009 - 07:15 PM

It's very enjoyable to read the conversation between two great minds and you took away any possible argument I could think of. Your joint solution is simply great to support future changes in the code! :)

#14 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 15 January 2009 - 07:45 PM

Thank you Nuno

@Peter

With GLOBAL the definitions are valid for a complete build, but not when running a single script.

I have tested and it work with GLOBAL even when running a single script.
:)
Pedro

#15 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 January 2009 - 09:27 AM

Thank you Nuno

@Peter
I have tested and it work with GLOBAL even when running a single script.
:)
Pedro

Not for a test in CodeBox!
In CodeBox as first line there is necessary:
AddVariables,%API%,ApiVar,GLOBAL

Peter

#16 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 16 January 2009 - 09:33 AM

With GLOBAL the definitions are valid for a complete build, but not when running a single script.

Is it possible that on individual script run, script.project will also be run prior, so that
&#91;Process&#93;

AddVariables,%API%,ApiVar,GLOBAL
is run to initiate the api commands?

Regards,
Galapo.

#17 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 16 January 2009 - 09:48 AM

I have the feeling that this (running script.project when individual script runs) might cause new trouble with the onbuildexit stuff and some other vodoo tricks i implemented...

I recommend caution when trying to add such functionality...

#18 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 16 January 2009 - 09:50 AM

I have the feeling that this (running script.project when individual script runs) might cause new trouble with the onbuildexit stuff and some other vodoo tricks i implemented...

Yes, I had the same thought just after I posted.

#19 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 January 2009 - 10:12 AM

I have the feeling that this (running script.project when individual script runs) might cause new trouble with the onbuildexit stuff and some other vodoo tricks i implemented...

I recommend caution when trying to add such functionality...

I agree to ctmag!

Peter

#20 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 16 January 2009 - 10:31 AM

Suggestion: WB should know whether it is the big play button which has been pressed, or whether it is an individual script button which has been pressed. Therefore, there could be two new 'System' commands reflective of this: 'System,INDIVIDUAL' and 'System,PROJECT' (or some other name along these lines. Then in script.project we could have:

&#91;Process&#93;

If,System,INDIVIDUAL,Equal,True,AddVariables,%API%,ApiVar,GLOBAL

If,System,PROJECT,Equal,True,Begin

  System,ONBUILDEXIT,Exec,%api%,LiveXP-ONBUILDEXIT

End
Then we could have script.project run before an individual script run without consequence.

Regards,
Galapo.

#21 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 16 January 2009 - 11:54 AM

???

The idea is good, but if used like in your example it would me every single script needs to be changed...or am i getting something wrong here?

#22 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 January 2009 - 11:57 AM

???

The idea is good, but if used like in your example it would me every single script needs to be changed...or am i getting something wrong here?

No, that would be in script.project only!

But I emotionally do not like the idea, I cannot yet explain clearly why.

Peter

#23 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 16 January 2009 - 01:16 PM

i hava somewhat the same felling.-)

But what i would like is a function (for use in scripts) to do some things when run by green triangle.

On the other hand i think a lot of this could also be done by improving the script code with already existing commands...

#24 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 16 January 2009 - 02:20 PM

But I emotionally do not like the idea, I cannot yet explain clearly why.

don't like an idea emotionally?!? :)

Peter is getting latin! :)

#25 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 January 2009 - 03:21 PM

don't like an idea emotionally?!? :)

Peter is getting latin! :)

Maybe I have had the feeling that this is hurting your 'Fundamental Intentions'

Hold things easy and straight on

..
But nevertheless:

I have finished a working concept where the magic wand:
  • Everytimes presents the actual project's API functions (or none if there is no API in the actual project)
  • Works also if a project is not yet built.
You now can see a menu:
apimenu.GIF

To bring to work, in Script.project in the variables section I added
%APIDEF%=API

And in Api.Script I included:
&#91;API&#93;

	   _Calculate=&#34;_Calculate,&#91;expression&#93;,&#91;Variable &#40;whithout %&#41;&#93;&#34;

	   _FileCopy=&#34;_FileCopy,&#91;Source&#93;,&#91;Target&#93;&#34;

	   Add_Asso=&#34;Add_Asso,&#91;Ext&#93;,&#91;Type&#93;,&#91;Title&#93;,&#91;Filename&#93;,&#91;Option&#93;,&#91;True for RegAddBoot&#93;&#34;

	   Ask_License=&#34;Ask_License,Filename,ID,Section&#34;

	   Associate_file=&#34;Associate_file,&#91;Ext&#93;,&#91;Type&#93;,&#91;Filename&#93;,&#91;Option&#93;,&#91;True for RegAddBoot&#93;&#34;

	   CopyProgram=&#34;CopyProgram,&#91;%FileBox_Source%&#93;,&#91;%Target_Prog%\%ProgramFolder%&#93;,&#91;%ProgramExe%&#93;,&#91;Archive to delete&#93;&#34;

	   QuickScript=&#34;QuickScript,RunFromRam,Section_or_7z_file,Add_Shortcut&#34;

	   RegAddBoot=&#34;RegAddBoot,RootKey,ValueType,Key,ValueName,Value&#34;

	   Require_File=&#34;Require_File,&#91;Folder\&#93;filename,&#91;Source &#40;if  source  is different of %Source_Sys%&#41;&#93;,&#91;Target &#40; If target is different of  %Target_Sys%&#41;&#93;&#34;

	   Require_Version=&#34;Require_Version,Filename,Version,Section&#34;

	   Unpack=&#34;Unpack,&#91;Folder&#93;,&#91;Archive&#93;,&#91;Option&#93;,&#91;%Target_Prog%&#93;,&#91;%ProgramFolder%&#93;,&#91;%programExe%&#93;,&#91;Target_Temp&#93;&#34;
And of course -not visible here- it inserts the code into the CodeBox or current script resp.

This new API section is a 'quick and dirty write down' and only something for test.
It does not claim to be complete, 'nice' or logically correct.

Pedrole#15 and the forum should correct it.

For all the crazy people who want to have it just before it becomes public:

You can get it here
But be careful: The version shows an 'API'. Do it really use ONLY FOR API tests.

The internal variable structure has been significantly changed. And I did not test for standards.

Peter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users