Jump to content











Photo
- - - - -

API functions inside WB's Magic Wand


  • Please log in to reply
68 replies to this topic

#26 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 - 03:33 PM

It's looking good from the screenshot!

I assume that when one clicks on a API command it will also add the expected work syntax.

Guess the tough part now will be documenting the API commands to ease the life of developers when it comes to figure what each function does.

:)

#27 pscEx

pscEx

    Platinum Member

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

Posted 16 January 2009 - 03:36 PM

I assume that when one clicks on a API command it will also add the expected work syntax.

You have to read my posts more carefully :)

And of course -not visible here- it inserts the code into the CodeBox or current script resp.


Peter :)

#28 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 - 03:38 PM

wow.. :)

I actually had to read it again line per line until I found the part you've quoted and there it was!

Guess I'm in danger of needing to use some glasses.. :)

#29 pscEx

pscEx

    Platinum Member

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

Posted 16 January 2009 - 05:22 PM

In CodeBox as first line there is necessary:

AddVariables,%API%,ApiVar,GLOBAL

Just a bump:

This issue is not solved by the new 'API magic wand' functionality and we should find a solution w/o the 'different starter's decisions'.

At least I'm not willing to write new commands into WinBuilder which decide how the run has been started.
And I think that Nunu agrees.

I am sure that it can be solved as smooth as the 'magic wand' issue, we only have to find the way ...

Peter

#30 pscEx

pscEx

    Platinum Member

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

Posted 16 January 2009 - 05:44 PM

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

Before I forget it:
Thanks a lot for the fundamental suggestion!
The 'slight' modification of your post

I think it is time to include the API commands.

Is now working!

Peter

BTW: Unfortunatelly I do not have a 'Thanks' button any more

#31 WetHat

WetHat

    Member

  • Members
  • 50 posts
  • Location:Black Forest
  •  
    Germany

Posted 16 January 2009 - 07:27 PM

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


Cool! Wouldn't it be good to add a [Api_Doc] section too to make the Project completely self documenting ?

WetHat

#32 pscEx

pscEx

    Platinum Member

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

Posted 16 January 2009 - 07:43 PM

Cool! Wouldn't it be good to add a [Api_Doc] section too to make the Project completely self documenting ?

That's the desision of The Boss.

I personally would refuse, because for me still is valid:

WinBuilder is a very sophisticated, but still stupid batching program without own individual decisions

And to do work into this dircetion, could decrease work in the 'batch' direction.
And 'the Project' of your post is really 'one of several projects'
Every project writer only uses script lines following certain rules.
He currently cannot be forced to do something for documentation or whatelse.

Peter

#33 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 16 January 2009 - 08:30 PM

This issue is not solved by the new 'API magic wand' functionality and we should find a solution w/o the 'different starter's decisions'.

At the moment, I still only see the two possibilities for script.project:

&#91;Process&#93;

AddVariables,%API%,ApiVar,PERMANENT

or

&#91;Process&#93;

System,INDIVIDUAL,AddVariables,%API%,ApiVar,GLOBAL

System,PROJECT,Begin

  AddVariables,%API%,ApiVar,GLOBAL

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

End

Note: the first option will NOT work for individual scripts unless the project has run at least once. There's some scripts requiring some setup where it is possible that the user may run a button on it prior to running the project for the first time, resulting in errors since the api variables would not be in place. Also, the use of 'PERMANENT' means that were back to a heap of variable commands being placed in script.project. I guess the 'AddVariables' command could be used at teh start of such scripts just in case, but it kind of defeats the purpose. As such, my vote is for the second option.

Regards,
Galapo.

#34 pscEx

pscEx

    Platinum Member

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

Posted 16 January 2009 - 08:38 PM

I'm more thinking about an option anywhere like
'Process "AddVariables,%API%,ApiVar,GLOBAL" as first line of CodeBox.'
which is default to 'True'

But do not do something with script.project, which is really innocent if somebody executes CodeBox.

Peter

#35 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 16 January 2009 - 09:00 PM

In CodeBox for working must be
AddVariables,%API%,ApiVar,GLOBAL

System,REBUILDVARS
We can also have a function Load_Api containing this line (which stay in script.project)
and just call it if need in CodeBox

Pedro

#36 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 16 January 2009 - 09:08 PM

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.

And why not adding this in Api.script rather in script.project
on individual script run, Api.script will also be run prior
There is no script that need api function before Level 2 or 3

Pedro

#37 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 16 January 2009 - 09:28 PM

OK, I see now.

Pedro's solution is a good one. Hopefully doesn't add much time to processing.

Regards,
Galapo.

#38 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 16 January 2009 - 09:40 PM

Api.script now is not run when we build a project
but we can make it run able so it is executed like other script
Variable are added for the entire project so for me it doesn't play on speed
the only needed is when running a single script it should be load before

Pedro

#39 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 16 January 2009 - 10:14 PM

I think i have missed something.
First there was talk about how to integrate the API commands into the magic wand and problems asociated with different solutions.

Then (all of a sudden) the discussion is about, if scripts, when run all by themselfs, can or can not use API commands. :)

How did the Magic wand functionality manage to break the 'normal' way the api works? One is display, the other is use. Two usually completely different things.


:)

#40 pscEx

pscEx

    Platinum Member

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

Posted 17 January 2009 - 10:24 AM

I think i have missed something.
First there was talk about how to integrate the API commands into the magic wand and problems asociated with different solutions.

Then (all of a sudden) the discussion is about, if scripts, when run all by themselfs, can or can not use API commands. :)

How did the Magic wand functionality manage to break the 'normal' way the api works? One is display, the other is use. Two usually completely different things.


:)

As MedEvil remarks correctly, the discussion is becoming rather strange.

To make clear:

To make the API commands in the magic wand possible, Pedro made some structure changes.

As a result:
  • Project build runs as before
  • Build as a single script runs as before.
  • Codebox
  • Without API commands: runs as before
  • With API commands: needs "AddVariables,%API%,ApiVar,GLOBAL" as first line in [Process]
To make use of this line easier, it is in the magic wand API menu as "CodeBox" (next nightly)

Peter

#41 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 17 January 2009 - 10:59 AM

Thanks for clearing this up for me! :)

Also if this is only a problem of the codebox why isn't the codebox simply executing the extra command by default?

:)

#42 pscEx

pscEx

    Platinum Member

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

Posted 17 January 2009 - 02:19 PM

Also if this is only a problem of the codebox why isn't the codebox simply executing the extra command by default?

Because
  • The Run button in Codebox
  • Stores CodeBox.txt
  • Runs CodeBox.txt.
    Not simple to insert just a command aywhere if not:
  • Write something int the file just behind [process]
  • Exectue the changed file
  • Delete what you inserted.
I do not like such file manipulations.
[*]The section name may vary from project to project
[*]There are projects w/o API. And executing that commend ...
[/list]But I solved the issue, and I'm going to publish a tutorial 'how to prepare API in magic wand' soon.

Peter

#43 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 17 January 2009 - 02:27 PM

Peter, i did not meant to have the file fixed, simply run the command before the file is run.

Good that you found a solution.

:)

#44 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 17 January 2009 - 04:37 PM

When playing with two project I got two api menu
2009_01_17_164319.gif
For api menu it would great to have sub menu possibility
2009_01_17_121142.gif
:)
Pedro

#45 pscEx

pscEx

    Platinum Member

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

Posted 17 January 2009 - 04:44 PM

When playing with two project I got two api menu
For api menu it would great to have sub menu possibility
Pedro

There has been a bug that sometimes the old API menu was not removed (It also remained when you switched to a non-API project).
That is fixed now in beta 6 b

I already thought about the submenu option with shortcuts, too.
But currently I do nor have any idea how to describe inside API.Script.

Maybe you have a suggestion (as already before which lead to the 'first' menu :) )

Peter

#46 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 18 January 2009 - 12:13 AM

Peter
I am perhap crazy but when thinking at possibility with sub menu api
Why not a personal menu for developper
You store some code line (Multiline) that you can call by a simple word
You start a new script ,you call the word New Script and the code you saved is inserted in the script with all section preformated
So it can be a great tools for all developper (w/o api)

Pedro

#47 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 18 January 2009 - 12:42 AM

There has been a bug that sometimes the old API menu was not removed (It also remained when you switched to a non-API project).
That is fixed now in beta 6 b

I still got the problem with beta 6 b but only in CodeBox
If not using CodeBox seem work well when editing script in two project

Pedro

#48 pscEx

pscEx

    Platinum Member

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

Posted 18 January 2009 - 10:39 AM

Peter
I am perhap crazy but when thinking at possibility with sub menu api
Why not a personal menu for developper
You store some code line (Multiline) that you can call by a simple word
You start a new script ,you call the word New Script and the code you saved is inserted in the script with all section preformated
So it can be a great tools for all developper (w/o api)

Pedro

I'm not sure whether I understand you correctly.
But I think it is not good to write any line in in a script order to activate sub menus.

Here my suggestion:

In addition to the already present lines in script.project

%APIVAR%=ApiVar
%APIDEF%=API

there is a line defining submenus, e.g.:
%APISUBDEF%=ShortCuts,Associate,Unpack

WinBuilder writes these comma separated <title>s as childs of 'API' and reads them from the [<title>] sections in Api.Script
The [<title>] sections are similar to the [%APIDEF%] section the entries for the magic wand.

Peter

#49 pscEx

pscEx

    Platinum Member

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

Posted 18 January 2009 - 11:08 AM

I realized it with this test enties in api.script:
&#91;ShortCuts&#93;

  Desktop=&#34;Add_Shortcut,Desktop,Folder,FullFileName,Title,Work Folder,Parameters,IconFile,StartMode,ToolTip&#34;

  StartMenu=&#34;Add_Shortcut,StartMenu,Folder,FullFileName,Title,Work Folder,Parameters,IconFile,StartMode,ToolTip&#34;

  

  &#91;Associate&#93;

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

  

  &#91;Unpack&#93;

  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;
apisub.gif

:)

Peter

#50 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 18 January 2009 - 09:41 PM

Hi Peter
Just download last version now
Good and well working :)
I prepare a new api
:)
Pedro




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users