How to add commands to blitzMax

BlitzMax Forums/BlitzMax Beginners Area/How to add commands to blitzMax

PowerPC603(Posted 2010) [#1]
Hi guys,

I've succesfully installed the Xors3D engine as a module in BlitzMax and all the demos work fine.
But the commands don't get highlighted in the BMax IDE.

I've tried rebuilding the documentation twice, but they still aren't there.
It's a pain to switch to the Xors3D documentation everytime to find a command and check it's syntax.

Do I need to move the module to the mod/pub directory, edit the module (in the header: "Module xorsteam.xors3d" to "Module pub.xors3d") and rebuild the modules? And then rebuild documentation?

Or is there another way?


PowerPC603(Posted 2010) [#2]
I tried moving the xors3d module into the pub directory, editing the header to "Module pub.xors3d" and rebuilding modules and finally rebuild documentation, but it still doesn't work.


Brucey(Posted 2010) [#3]
It depends how the documentation has been written for the module.

There need to be "bbdoc" comments in specific places for the documenter to pick them up and add them to the command-set.

Moving things to Pub won't help.


Gabriel(Posted 2010) [#4]
If you use Blide (I think it either needs to be Blide Plus or the module needs to be open source, but Ziggy can confirm this) then all the functions will not only be highlighted but you will have an intellisense popup to pick them from. Much, much faster than having to type things in full every time.


PowerPC603(Posted 2010) [#5]
I just checked the module.
There is no bbdoc anywhere.

The module appears to be a wrapper-file for the functions in the dll.


_Skully(Posted 2010) [#6]
just add:

rem
bbdoc:
endrem


Immediately above each command. That will give you the intellisense but not an explanation... thats the quickest solution.


SLotman(Posted 2010) [#7]
Don't forget to rebuild docs after adding the rem/bbdoc/about/endrem thing :)


Brucey(Posted 2010) [#8]
There is no bbdoc anywhere.

Undocumented?

Makes it easier to learn that way, I suppose?


B(Posted 2010) [#9]
I have asked this question before and Jesse helped me, but he did it for me and emailed me
the .mod folder, however I still do not know how to do it for myself.

Is there a tutorial/thread that goes into depth on how to add commands and sytax highlighting?

if so that would be great as I would like to know how to do this for myself.

Thanks!


PowerPC603(Posted 2010) [#10]
I tried the rem/bbdoc:/endrem but it doesn't work.

Near the bottom of the xors3d.bmx file, there are wrapper functions, which include default parameters.
I've added the "rem/bbdoc:/endrem" just above some of those functions, but they still don't get highlighted.
Pressing F1 doesn't display the syntax in the infobar at the bottom of the IDE.

I'm using the default BMax IDE, not BLIde.


Zeke(Posted 2010) [#11]
Rem
	bbdoc: blaa blaa
endrem
Function xLoadBrush%(path$, flags% = 9, xScale# = 1.0, yScale# = 1.0)
	Return xLoadBrush_%(path$, flags%, xScale#, yScale#)
End Function

^^ are you sure you added rem/bbdoc/endrem like this (and just above function,no empty line between endrem and function xxx...)
and remember rebuild documentation


PowerPC603(Posted 2010) [#12]
Yes I did.
I've even looked at the brl.math module and there it was like this:
Rem
bbdoc: Check if a value is NAN
returns: True if @x is 'not a number' (eg: Sqr(-1))
End Rem
Function IsNan( x:Double )="bbIsNan"


There it was "End Rem" instead of "endrem".

I copied this to the line just above some functions in the xors3d module, but BMax still doesn't highlight the command.

Like this:
Rem
bbdoc: Check if a value is NAN
returns: True if @x is 'not a number' (eg: Sqr(-1))
End Rem
Function xLoadBrush%(path$, flags% = 9, xScale# = 1.0, yScale# = 1.0)
	Return xLoadBrush_%(path$, flags%, xScale#, yScale#)
End Function


I even rebuilt the xors3d module before rebuilding the documentation.
All BMax does, is adding an empty "doc" folder in the xors3d module directory.


Zeke(Posted 2010) [#13]
ah.. found problem..
rem
bbdoc: xors3d
endrem
Module xorsteam.xors3d


you need to rem/bbdoc/endrem Module then it works.

there should be some tutorial how to create and document a module. :D


PowerPC603(Posted 2010) [#14]
Thank you Zeke, now it works perfectly.


Brucey(Posted 2010) [#15]
there should be some tutorial how to create and document a module

I believe there is.


Nigel Brown(Posted 2010) [#16]
I am having problems getting my Methods showing the Module has always been documented, just ran blide and re-built module database and it works perfectly there allowing me to do things like modulename.methodname() and giving me access to auto complete, why does this not work in MAXide?


PowerPC603(Posted 2010) [#17]
MaxIDE doesn't have autocomplete AFAIK.

It can only highlight BMax commands/methods and show the syntax.
But that's about it I guess.