PDA

View Full Version : Squint - the sqf editor and error-checker



Pages : [1] 2

sbsmac
Aug 19 2010, 21:48
I'm pleased to announce that squint is ready for its first public release.

Squint is an editor and error-checker for ArmA script files (sqf, cpp, ext, sqm) and can save you many hours of headache by detecting syntax errors and common logic problems before you even run your scripts in a mission.

You can learn more about it from this presentation (https://docs.google.com/present/view?id=dcd8x6gv_5d6hsn3hd). (If anyone knows how to embed iframe tags in this forum please let me know.)

there is also a basic guide to getting started (https://docs.google.com/present/view?id=dcd8x6gv_25c3rp7qc7).

Installation instructions are here (https://sites.google.com/site/macsarmatools/squint/installation-1) or you can just run the setup file from my homepage (http://homepage.ntlworld.com/n.macmu.../bin/setup.exe ).

Please be patient while I tidy up the documentation over the next few days. There are certain to be a few bugs as well, please help me out by reporting them rather than ignoring them. I'm also particularly keen to get your suggestions on the kinds of errors you find in your code which squint does not yet catch.

Here's a screenshot...
http://www.armaleague.com/mac/misc/what3.PNG

kylania
Aug 19 2010, 21:55
Looks great! Nice work! That little guy in the basic guide is awesome, with a capital AWESOME.

Petko
Aug 19 2010, 22:02
WOW! Thats astonishingly great stuff.

Muzzleflash
Aug 19 2010, 22:05
I tried your first version and that was quite confusing. This version looks much more nicer. Just hope I can change the background away from black.

However, you need to fix the link to the setup file, 404 here.

Laertes
Aug 19 2010, 22:12
I'll be succint:
This is awesome.

sbsmac
Aug 19 2010, 22:12
Oops - setup link fixed, thanks for that.

Yes, you can completely customise the colours used in the code-window by going to the Settings/Fonts and colours menu option.

Muzzleflash
Aug 19 2010, 22:31
I Just fired up my mission and "imported"/add folder. I seems very useful. I fixed all of the errors the hard way already, but it offered to help me with my privates.

Here's my suggestions
- Tabs are evil. Not the actual tab button but the \t one. An option to make an number of spaces when you press tab instead would be nice. If you ever used N++ you know what I mean.
- When you fix missing private declarations it does not indent properly. The text start out completely to the left even if your spawn for example is more to the right.
- Does not detect bis function BIS_fnc_infoText
- Parameters: I use an technigue seen in AAS where the parameters' classes names get assigned to the selected value. Eg. an "class P_Hour" in description.ext get's set to 11 when game starts. P_Hour is non-recognised variable. I know this not possible to do with dynamic variable assignment, however, detected param classes or make an option to turn off the warning perhaps?
- One of my files in UTF-8 without BOM, contained a non-ascii (>127) character. This character got interpreted wrong.

Hope you find at least some of this feedback useful. Keep up the good work :bounce3:.

Edit:

- This is not important unless you have OCD or something like that. If you do have something like that then this: When changing the font type you have to write a character or something similar to get the text in the window to change.

sbsmac
Aug 19 2010, 22:39
Thanks. A few comments.

Changing tabs to 'n' spaces should be fairly straightforward.

Indenting is 'hard' for the parser since it only deals with a logical stream of tokens and expressions rather than knowing about format and spacing. I'm looking at some auto-indent for sqf though in the future (squint can already auto-format cpp).

None of the BIS functions are currently recognised. I just need to build a dictionary for these when I can get to my gaming PC (my back is fubared right now and I'm confined to bed with a crappy laptop).

Parameters- can you provide a short code-example and I'll see what I can do.

UTF8... yes the bane of my life. The richtextbox control used in squint doesn't understand UTF-8 and even if it did, handling multi-byte characters through the data-path would be a serious headache for me atm. *Most* non-ascii's should be handled correctly now but I'm prepared to believe there may be a few that escape under certain circumstances. Again, if you can provide a specific example I can take a look.

JDog
Aug 19 2010, 22:42
it offered to help me with my privates.
^LOL

Nice I'll be downloading ASAP.

SNKMAN
Aug 19 2010, 22:47
Nice tool sbsmac. :)

Muzzleflash
Aug 19 2010, 23:04
Parameters- can you provide a short code-example and I'll see what I can do.
Again I understand dynamic variable assignment is tough and it is totally fine if you decide my parameter case does not warrant an exception. Here is part of an description.ext:


class P_Hour
{
title = "Hour of day";
values[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
texts[] = {"00:XX", "01:XX", "02:XX", "03:XX", "04:XX", "05:XX", "06:XX", "07:XX", "08:XX", "09:XX", "10:XX", "11:XX", "12:XX", "13:XX","14:XX", "15:XX", "16:XX", "17:XX", "18:XX", "19:XX", "20:XX", "21:XX", "22:XX", "23:XX"};
default = 12;
};
The following script turns the class into a variable. If run in the editor then P_Hour = 12;. Cause 12 is default. In mp or somewhere where you can specify parameters it get's set to that value. The benefit of this approach I think is that it does not require you to maintain order in the params and you don't do manual indexing into paramsArray. This is the script that does the work:


if (isNil "paramsArray") then {
if (isClass (missionConfigFile/"Params")) then {
for "_i" from 0 to (count (missionConfigFile/"Params") - 1) do {
_paramName = configName ((missionConfigFile >> "Params") select _i);
_paramValue = getNumber (missionConfigFile >> "Params" >> _paramName >> "default");
call compile format ["%1 = %2", _paramName, _paramValue];
};
};
} else {
for "_i" from 0 to (count paramsArray - 1) do {
_paramName = configName ((missionConfigFile >> "Params") select _i);
_paramValue = paramsArray select _i;
call compile format ["%1 = %2", _paramName, _paramValue];
};
};
Again this might be a special case, however you need some way to tell squint that this variable, even if not recognized, is okay. "I got this one squint".



UTF8... yes the bane of my life. The richtextbox control used in squint doesn't understand UTF-8 and even if it did, handling multi-byte characters through the data-path would be a serious headache for me atm. *Most* non-ascii's should be handled correctly now but I'm prepared to believe there may be a few that escape under certain circumstances. Again, if you can provide a specific example I can take a look.
I'm surprised that .Net does not support UTF all the way. A specific example is this:
In N++:


/*
Søren Enevoldsen - Muzzleflash - Deadecho
*/

In Squint


/*
Søren Enevoldsen - Muzzleflash - Deadecho
*/

I noticed that my file somehow got saved with BOM. I changed it back and reloaded in squint it did not make a difference to it's interpretation.
EDIT: The good part is at least is saves the character(s) the same way it loads them. Saving in Squint (with the expanded byte representation) produces the correct result, which I verified by loading in N++ after.

-------------------------

^LOL

Nice I'll be downloading ASAP.
Yeah had a laugh myself when I wrote that :D

---------- Post added at 01:04 ---------- Previous post was at 00:49 ----------

Using the preprocessed view seems to FUBAR the syntax highlighting (Notice the T too):

http://www.sorenenevoldsen.dk/problem.jpg

Squint
Aug 20 2010, 00:00
I approve of your choice of name.

ruebe
Aug 20 2010, 01:09
I'm also particularly keen to get your suggestions on the kinds of errors you find in your code which squint does not yet catch.

Yay! I finally managed to come up with one. (just reported)
:drinking2:

But that default background color for the editor window.. sure, fortunately one may change it, but still....
...are you friggin serious?!

Black!? :icon_bash:

:D

kylania
Aug 20 2010, 01:13
One of the web guys I work with swears by a black background for coding. I have no idea why! :)

Laertes
Aug 20 2010, 01:53
Yay! I finally managed to come up with one. (just reported)
:drinking2:

But that default background color for the editor window.. sure, fortunately one may change it, but still....
...are you friggin serious?!

Black!? :icon_bash:

:D
Well, if you're using it for extended periods of time, black is easier on the eyes than white, and it also makes the highlighting more... highlighted.

gunterlund21
Aug 20 2010, 02:45
flippin awesome tool. fixed a bunch of errors right on loading. Thanks for a great tool.

an this work for HPP files?

cobra4v320
Aug 20 2010, 03:24
Awesome tool thanks for sharing, already found some errors in a couple of scripts that I didnt even notice.

ruebe
Aug 20 2010, 03:45
One of the web guys I work with swears by a black background for coding. I have no idea why! :)

Maybe that way it feels more like Neo hacking the matrix or something in this direction :cool:


Well, if you're using it for extended periods of time, black is easier on the eyes than white...

Black? As a background color? Easier on the eyes? To read (white and even colored!!!) text?
...

Are you shitting me?
:D

CarlGustaffa
Aug 20 2010, 04:12
I don't use black, but very dark colored background. Less blinding than white background. When you play a lot of "dark missions", it matters a lot. I even have means to put a red/black marker over the map to make it less blinding.

You should see my UltraEdit colors :D

Soul_Assassin
Aug 20 2010, 04:37
cool tool. from a cpp point of view I would love to see a class explorer which would allow quick navigation in huge configs.

Laertes
Aug 20 2010, 07:16
Maybe that way it feels more like Neo hacking the matrix or something in this direction :cool:



Black? As a background color? Easier on the eyes? To read (white and even colored!!!) text?
...

Are you shitting me?
:D
To read white text, it'd be bad, but it's almost all highlighted in different colours. So for me at least, it's easier on the eyes than having the same highlighting but a white background.

callihn
Aug 20 2010, 07:32
OMG! This is AWSOME!


None of the BIS functions are currently recognised. I just need to build a dictionary for these when I can get to my gaming PC (my back is fubared right now and I'm confined to bed with a crappy laptop).

Surely someone can help with this?

Kremator
Aug 20 2010, 07:38
VERY nice!

callihn
Aug 20 2010, 07:44
Please enable "Browse" for folder ASAP.

I find that nice because you can copy and paste the folder your in already.

Also an undo would be real nice and when you go to reload a project and want to dump all your changes it really shouldn't ask me about every file that has changed.

sbsmac
Aug 20 2010, 08:01
Obviously some of you never had to work with white/green on black monochrome 40x25 monitors back in the day..... ;-) And you should be grateful I changed the font away from 'Comic Sans' which I'd been using as a placeholder during development.

Anyway you can change colours by going to the "settings/fonts and colours" menu option. I may at some stage introduce different 'themes'. In the meantime everlasting glory will go to the person who can come up with a nicer combination of colours and post it here as a new default. The easiest thing to do is post a small screenshot and a link to your config file which is well hidden on your disk but which you can find by running this command at the command prompt


c:\> findstr /s squint.Properties.Settings user.config

If this command turns up multiple files and you're not sure which one is correct, try changing the Settings/Path to something unique like "jabberwocky" and searching for that instead.

To answer some of the other points...


you need some way to tell squint that this variable, even if not recognized, is okay. "I got this one squint".

Yep on the list - see http://dev-heaven.net/issues/12493 . I'll probably just start out with a 'per-file' exception mechanism.



(on UTF-8) The good part is at least is saves the character(s) the same way it loads them


Yes I worked quite hard to make sure that what went out was the same as what went it. Handling different encodings is 'difficult' especially as the data-path assumes that each character is one byte (not good for internationalisation but indexing errors into the file is a nightmare otherwise).


Using the preprocessed view seems to FUBAR the syntax highlighting (Notice the T too):

Yep- known issue -see http://dev-heaven.net/issues/12912



Can this work for HPP files?

Yes, if you drag an hpp file into the file list you can open it but they are currently mis-categorised as sqf files. To fix this, just right-click on the filename in the file-list and choose "Select Grammar->CPP" from the popup menu.


from a cpp point of view I would love to see a class explorer which would allow quick navigation in huge configs.

You can already use simple text search but it would be fairly straightforward to add a right-click option to show both parents and owners. For example if you right-clicked on 'class myMagazine' you might get a little dialog showing....

Owners: Magazines>>USMagazines>>SD>>myMagazine
Parents: myMagazine:myDefaultMag:30rndStandardMag:Magazine

More interesting would be the ability to 'jump to parent/owner' from a right click. I don't work with configs a lot so let me know what kinds of things would be useful.


Please enable "Browse" for folder ASAP.

Can you be a bit more specific ? Are you talking about the "File->add to project->Folder" browser ? It's a bit rubbish - will look at changing it. Tbh I never use "File-add To project", it's much easier just to drag files, folders or pbo's from the desktop into the file-list to add them to the project.


- This is not important unless you have OCD or something like that. If you do have something like that then this: When changing the font type you have to write a character or something similar to get the text in the window to change.
Good catch - will add to the list.

callihn
Aug 20 2010, 09:16
Obviously some of you never had to work with white/green on black monochrome 40x25 monitors back in the day..... ;-) And you should be grateful I changed the font away from 'Comic Sans' which I'd been using as a placeholder during development.

HaHaHaHa! Yea, seriously, it was not just the monitors getting burn in.



Can you be a bit more specific ? Are you talking about the "File->add to project->Folder" browser ? It's a bit rubbish - will look at changing it. Tbh I never use "File-add To project", it's much easier just to drag files, folders or pbo's from the desktop into the file-list to add them to the project.

Yea, that's the one, sorry, didn't know you could drag. :o

BTW, why does it keep coughing at these?:

#include "Scripts\TeamStatusDialog\TeamStatusDialog.hpp"

Says: "Missing semi-colon or operator"

Also, right click copy and paste might help allot of folks and perhaps a switch to hpp/sqf mode there too someday.

But again, it's wonderful, just shaved some time off for sure and fixed quite a few issues as well. :yay:

sbsmac
Aug 20 2010, 09:28
BTW, why does it keep coughing at these?:

#include "Scripts\TeamStatusDialog\TeamStatusDialog.hpp "

Says: "Missing semi-colon or operator"

There's something it doesn't like inside that included file. The easiest way to figure it out is to switch to preprocessed view (the '#' toolbar button) and highlight the error. Note though you can't edit stuff in preprocessed view for the reasons outlined in the FAQ (https://sites.google.com/site/macsarmatools/squint/faq)



Also, right click copy and paste might help allot of folks and perhaps a switch to hpp/sqf mode there too someday.

CTRL-C, CTRL-V, CTRL-X all work in the code-window :-) You can switch between cpp/sqf mode by right-clicking on the filename in the file-list. The choice of grammar is persistent so it'll be remembered next time you start up the project. The fact that hpp files start in 'sqf' mode is a bug which I'll fix shortly.

Tankbuster
Aug 20 2010, 10:22
Squint save lives people! Use it.

Especially if you can't count/match your brackets and braces. :)

sbsmac
Aug 20 2010, 10:48
Especially if you can't count/match your brackets and braces.

Just added a new feature just for you ! Right-click anywhere in the code-window and select 'highlight bracketed area' and the squint will highlight the extent of the immediately-surrounding brackets. This works with normal brackets '(', braces '{' and arrays '['. :)

Tankbuster
Aug 20 2010, 10:50
LOL, just for me? Are you suggesting I'm the only muppet who can't count? :D

Ben_S
Aug 20 2010, 10:56
This is awsome. Good job, very handy indeed. :)

CarlGustaffa
Aug 20 2010, 11:19
I may at some stage introduce different 'themes'.

Here is my contribution, my UltraEdit colors (http://www.flickr.com/photos/54973802@<hidden>/4910194934/sizes/l) :p

Li0n
Aug 20 2010, 11:58
Thank, that is nice :) But I can not setup in because it says that it nedd 1.6 Gb free space. I have it but not on drive C, and seems, it wants to install there.

sbsmac
Aug 20 2010, 12:08
1.6Gb -wtf ?!?! ;-) The app itself is somewhere between 300 and 400 Kb! Even .NET4 is probably only around 100Mb. Where is the message about 1.6Gb coming from ?

*Edit* Are you sure that the installer isn't prompting you to install windows first ? :-P

Muzzleflash
Aug 20 2010, 12:41
Oh sorry didn't know you had a bug tracker where all the issues I posted were already on.

sbsmac
Aug 20 2010, 12:50
Not all of them - a couple of things you reported were new :-) Anyway, new update fixes the following...

* Bug #13106: Add 'highlight matching brackets' feature
* Bug #12857: Need to catch orphan commas in arrays
* Bug #12912: Highlighting of comments in preprocessed view is incorrect
* Bug #13099: not detected script error (variable followed by a string, but not delimited by a comma - inside array definitions!)
* Bug #13103: Default grammar for hpp should be 'cpp'

Muzzleflash
Aug 20 2010, 13:00
Great

I would like to know how you see the usage of squint.

1. A static analyzer only with very limited editing capabilities to just fix bugs?
2. Above however with slightly more capable editing capabilities?
3. Other?

If 2 or 3 (depending on 3), would you consider adding auto completion? I did not see that request on the tracker and think unlike my N++ which has only auto completion for known keywords you can auto complete locals and globals, and maybe macros too since you detect types?

sbsmac
Aug 20 2010, 13:14
Originally the concept was that squint would be a back-end static-analyser tool like 'lint' (Indeed, I will probably release a command-line standalone version at some point.)

However I've come to see it as more of an editor with interactive static-analysis and will almost certainly be adding to the editing capabilities. I now tend to use squint as my main editor for sqf despite otherwise being a die-hard emacs user.

Working with Visual Studio and Intellisense has really given me an appreciation for auto-completion and the advantage squint has is that it should be able to do this in more of a 'context-aware' fashion than basic editors. Your example of local variables is a good one and squint could also do things such as suggesting function names for 'call' or adding 'electric brackets' (if you've ever used emacs you may know about this.)

Anyway, added to the list as http://dev-heaven.net/issues/13109

Sniperwolf572
Aug 20 2010, 13:28
Here is my contribution, my UltraEdit colors (http://www.flickr.com/photos/54973802@<hidden>/4910194934/sizes/l) :p

http://img14.imageshack.us/img14/3619/cobaltj.th.jpg (http://img14.imageshack.us/img14/3619/cobaltj.jpg)

I prefer blues. Go go Cobalt theme. :p

sbsmac
Aug 20 2010, 13:34
Thanks for the screenshots guys but I only accept entries to the competition if accompanied by a user.config file since I don't have the time (or necessary artistic eye!) to try to match your screenshots against the names of windows colours. :-)

sbsmac
Aug 20 2010, 16:32
would you consider adding auto completion?

I've just added a rather experimental implementation in v1.0.0.71

It's off by default and to enable it you have to go to the 'advanced' menu and check "Enable keyword prediction"

At the moment it only knows about reserved keywords but it's easy to extend it to know about local variables, global variables and function names.

You can probably break it if you try hard enough ! If you do, let me know.

Start typing "dis..." You'll see the list of acceptable completions narrow as you type more characters. Use up/down arrow keys to select one of the completions. Press ENTER to autocomplete with the selected option.
Press ESC to banish the box.

Muzzleflash
Aug 20 2010, 16:48
Great job :).

I've broke it on my first keypress :o. Pressing enter at end of line seems to cause it to fail with: "Object reference not set to an instance of an object".

More detailed:


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at squint.AutoComplete.CharTyped(KeyEventArgs c)
at squint.Form1.richTextBox1_KeyDown(Object sender, KeyEventArgs e)
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
squint
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/S%F8ren/AppData/Local/Apps/2.0/KKCVVVH6.8KB/855TTKOK.H7Q/squi..tion_3d804d6cf9fd5b6a_0001.0000_ff5eb78b675e61bd/squint.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Mac.Arma.FileFormats
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///C:/Users/S%F8ren/AppData/Local/Apps/2.0/KKCVVVH6.8KB/855TTKOK.H7Q/squi..tion_3d804d6cf9fd5b6a_0001.0000_ff5eb78b675e61bd/Mac.Arma.FileFormats.DLL
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Deployment
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
mac.XML
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/S%F8ren/AppData/Local/Apps/2.0/KKCVVVH6.8KB/855TTKOK.H7Q/squi..tion_3d804d6cf9fd5b6a_0001.0000_ff5eb78b675e61bd/mac.XML.DLL
----------------------------------------


Some kind of hotkeys for activation perhaps in later versions? I sometimes use the arrow keys to move the caret around. Doubt i'm the only one. On activation the arrows keys are allowed to be "taken" of course?

I did get it working by pressing continue and start on a fresh line, however.

sbsmac
Aug 20 2010, 16:55
Lol- I hadn't expected it to be thateasy to break ! The theory with the arrow keys is this...

Once auto-complete is active, arrow keys are bound to it. You can easily unbind them though by pressing ESC to cancel auto-complete. This system seems to work pretty well for MSVC. Anway, I'll take a look at the breakage and fix it up in a while.

Muzzleflash
Aug 20 2010, 17:03
My bad. Just fired up MSVC and that indeeds work well.

There is one difference though. MSVC only gives the autocompletion if you actually write a character. Here pressing the up-arrow with nothing written gives the autocompletion box anyway, giving you only the mouse for moving the caret, even if you just want to go one line down or up.

And the ESC doesn't help in this situation. Since it just closes the window and it pops up on next press again.

sbsmac
Aug 20 2010, 17:12
Ok - give the new version a try.

Muzzleflash
Aug 20 2010, 17:36
Yeah now it works. Agile Development ftw. :bounce3:

One small nitpick. Whenever you move the caret left and it "passes" through non-whitespace a "%" appears as a viable autocompletion, thus preventing vertical arrow movement. What is this % for? Is it for format statements?

Wiggum
Aug 20 2010, 18:12
This Tool looks great ! :)

One question:

Squint uses ClickOnce deployment which means that it will always keep itself up to date and you don't need to worry about checking for new versions.

What does this mean exactly ?
Is this some kind of AutoUpdate i can deactivate in a Menu or something else ?

Muzzleflash
Aug 20 2010, 18:43
This Tool looks great ! :)
One question:
What does this mean exactly ?
Is this some kind of AutoUpdate i can deactivate in a Menu or something else ?
It is the way the program get's deployed. You download a small setup file which brings up a windows where you can choose to install.

Regarding the autoupdate. I think it is an autoupdate that you can't disable in the menu.

Wiggum
Aug 20 2010, 19:29
@<hidden> Muzzleflash

...now im even more confused... ;)


You download a small setup file which brings up a windows where you can choose to install.

Isnt this the way every installer works ?


Regarding the autoupdate. I think it is an autoupdate that you can't disable in the menu.

Thats something i dont like. I normally disable all auto updates...i dont like it if there is something going on in the background while playing or working on the PC.

Muzzleflash
Aug 20 2010, 19:33
@<hidden> Muzzleflash
...now im even more confused... ;)
Isnt this the way every installer works ?

Thats something i dont like. I normally disable all auto updates...i dont like it if there is something going on in the background while playing or working on the PC.
ClickOnce is not the typical installer in that it as far as I know does not contain the program. You download this "setup" file that ask you if you want to install. If you do then the program gets downloaded and installed.

Whenever you run the program it checks for update and install that if available. Maybe you can disable this update by using your firewall I don't know haven't tested. This update isn't run on random. It is checking everytime you start the program only. So it won't disturb you during gaming or other activities. The check only takes 1 or 2 seconds here then the program starts, unless there's large updates then it might take up to 10s total to download/install the update and start.

This method of installing and updating a .NET program I think is what's called ClickOnce.

sbsmac
Aug 20 2010, 20:05
Whenever you move the caret left and it "passes" through non-whitespace a "%" appears as a viable autocompletion

This was a bug caused by the fact that the keycode for left-arrow turns into '%' when cast into a char in combination with the fact that the dictionary for the autocomplete contained ALL keyword/operators rather than just the alphabetic ones.

Anyway, fixed now :-)

WRT ClickOnce... Wikipedia covers it fairly well http://en.wikipedia.org/wiki/ClickOnce and MuzzleFlash also explained it in detail so I don't have a lot to add but here's the way it works....

When I create the application, it is split into a small 'setup' file and then the main bulk of the application. The setup file contains a link (URL) to the location of the main application so it can be stored it a completely different location. (You can even email round the setup file or use a really old version and it will still work.)

When you run the setup file it looks in the expected location for the application and uses some metadata to figure out which is the latest version it needs to download in order to install it.

Once you have installed the application it contains some similar code to the original setup file. Every time you start it, it briefly checks the original download location to see whether a newer version is available and installs it if one is.

Apart from that it is non-intrusive and does not sit in the background checking periodically. Hope that explains it.

CyOp
Aug 20 2010, 20:46
sbsmac,

Thank you very much for Squint (and to those that helped, and are helping you). I like it. Although, I am not 'good enough' with scripting to be able to use it fully.

I loaded two files that I have been working on and was surprised to discover I had no mistakes (except it helping me set private variables). However, I loaded a file I am using from someone else, and it had multiple 'problems', and I just could not figure out how to fix them. Bummer.

Sooo, are we able to use this thread to post and get help with 'stuff'?

Thanks again, 'you guys', and keep up the great work. :)

sbsmac
Aug 20 2010, 20:58
Yes, please do post here for help. There is also some (incomplete) documentation on typical errors at https://sites.google.com/site/macsarmatools/squint/errors which may be a helpful first step.

callihn
Aug 20 2010, 21:26
CTRL-C, CTRL-V, CTRL-X all work in the code-window :-)

Ohh I know that but then I remember monocrome monitors too. ;)

Noticed an update today and haven't had a chance to use it yet, but I also want to mention in case you haven't fixed it that when I have for example:

// Author
private ....

or

//Author
if (!isServer).....

It says it wants to place all of it with the new private, comment included.

Gone to play with the latest version, keep up the good work.

BTW, do we always get the latest version from that original link?

sbsmac
Aug 20 2010, 22:36
Well spotted -that's a bug.

>BTW, do we always get the latest version from that original link?

You should never need to manually update the program since it checks for updates every time you run it and updates itself if a newer version is available.

---------- Post added at 11:36 PM ---------- Previous post was at 10:36 PM ----------

Ok, bug with comment being replaced by 'private' is now fixed.

Also auto-completion now works with local variables (only those that are mentioned in the current scope though - that's a 'feature'). It's dreadfully slow at the moment since it's using some very inefficient brute-force algorithms. I'll need to tidy it up when I add support for function names.

Muzzleflash
Aug 20 2010, 22:42
I tried making a user on devheaven however i'm unable to login. So I'll post it here:

Feature Request - Selecting/Marking a word (non-whitespace-separated text) should highlight matching word in document.
Minor Bug - Double clicking a word selects an extra space. Underscore seems to functions as widespace regarding double clicking thus local won't get completely selected.

D3lta
Aug 20 2010, 22:56
Fantastic!! Amazing!!!! Supreme!!! The best!!!
Thanks sbsmac!!!!! :D:D:D:yay:

A Question: is UTF-8 support ok?

sbsmac
Aug 20 2010, 23:35
One last update before bed....

auto-complete is now much more efficient and now implements standard unix-shell type tab-completion. Ie, if you type
'pl' auto-complete will list all commands starting with 'pl' but since they all actually start with 'play' you can press tab to fill in the 'ay' automatically.

Reminder - you need to turn on auto=complete from the 'Advanced' menu if you want to play with it.

@<hidden> - yep there's already a bug open about the double-clicking.

@<hidden> - UTF-8 files (with or without BOM) can be loaded and saved out again without any character-mangling that I've noticed although as has been noted, some non-ascii characters may not display as you would have expected.

Muzzleflash
Aug 21 2010, 00:08
Hey you forgot to tell that auto-complete detects locals now. :)
However, it throws exceptions at me like a mad man again now. Try writing "net" on an empty line. I guarantee you are not allowed!. :(

Key not in dictionary error. Better catch that one ;).

Wass
Aug 21 2010, 03:28
Errors when i use code like this in description.ext



class CfgSounds
{
sounds[] = {};


#define s(a) \
class s##a \
{ \
name = "sound"; \
sound[] = {\sound\s##a.ogg, db+0, 1.0}; \
titles[] = {0, $STR_s##a}; \
}; \

s(1);
s(2);
s(3);
s(4);
s(5);
s(6);

};

or this one

class CfgIdentities
{

#define ID(x, nm, fc, gl, sp)\
class ##x \
{\
name = ##nm;\
face = ##fc;\
glasses= ##gl;\
speaker = ##sp;\
pitch = 1.000000;\
};\

ID(Boevik, "$STR_Boevik", "Face74", "none", "Male03RU")
ID(Pl1, "$STR_Pl1", "Face23_camo3", "none", "Male02RU")
ID(Pl2, "$STR_Pl2", "Face67_camo3", "none", "Male05RU")
ID(Pl3, "$STR_Pl3", "Face12_camo3", "none", "Male03RU")
ID(Pl4, "$STR_Pl4", "Face49_camo3", "none", "Male04RU")
ID(Pl5, "$STR_Pl5", "Face90_camo3", "none", "Male01RU")
ID(Pl6, "$STR_Pl6", "Face62_camo3", "none", "Male05RU")
ID(Pilotvt, "$STR_Pilotvt", "Face25", "none", "Male02RU")
ID(cop, "$STR_cop", "Face90", "none", "Male02RU")
ID(drv, "$STR_man", "Face12", "none", "Male02RU")
};

it write me

missing } before end of file
in game it work well.

Scrub
Aug 21 2010, 03:41
Thank you sbsmac! Your GUI took away the vast majority of my stupid errors (significant to say the least) and is teaching me the way syntax SHOULD be done. Thanks! I now have the gumption to code again! :D

callihn
Aug 21 2010, 03:52
Well, sadly when it was all said and done I broke more than I could ever fix, it seems some things should not be in a private despite what Squint thinks, just try grabbing a domination mission and running it through, particularly TeamStatusDialog.sqf was broken in this manner.

Look at Bushlurker's Panthera Domination port, which I'm trying to modernize and have some additions to, I think it has the ability to help you fine tune your app, if it could go through there and fix things without breaking them it should work on anything.

Guess it's not quite dummy proof yet, but a great tool for the rest, hope it gets there someday and it looks like it is heading there fast, meanwhile I'm pretty sure you'll be able to get things in line by running it through that mission.

Also having problems with these comment examples:


// ...

if (!isServer) exitWith{};

_vehicle = _this select 0;
_delay = _this select 1;
_moved = false;
_startpos = getpos _vehicle;
_startdir = getdir _vehicle;
_type = typeof _vehicle;


// ...

player action["EJECT", (_this select 0)];

if (vehicle player isKindOf "ParachuteBase") then {
_vec = vehicle player;

Also when it places privates in front of something it does so without a new line, like so:


Blah, Blah;
Blah;

Becomes:


private ["_blah"];Blah, Blah;
Blah;

rather than:


private ["_blah"];
Blah, Blah;
Blah;

Wass
Aug 21 2010, 05:44
Also when it places privates in front of something it does so without a new line, like so:


Blah, Blah;
Blah;

Becomes:


private ["_blah"];Blah, Blah;
Blah;

rather than:


private ["_blah"];
Blah, Blah;
Blah;

it does not matter, because charter ";" here. It saparate commands in line.

CarlGustaffa
Aug 21 2010, 05:56
Well I just had a brief scan through my own Domination modification. Although there were lots of "false positives", warnings that can safely be ignored, I sure had my share of facepalm moments. More than expected, that's for sure.

A couple of issues with the application:
1) Auto-update without user control - huuuge no no from me. Had to block it on the firewall, which results in a very slow startup. Paranoia is a skill :p
2) Installed (incl. Net4) a few days ago, didn't reboot until today. So I don't have the latest version yet (will do soon, I just ran a couple of tests). But mouse hoverover doesn't allow me to scroll other windows.
3) A little too helpful in trying to help me select things (lmb dragging text, i.e. strings, private declared etc). In some cases I'm completely unable to select what I want, application overrides me completely and select either less or more.
4) Would be nice to be able to set the white colors in the other windows to a user color as well. Especially now that I'm dead tired :p
5) I can't believe anyone is able to code without courier font :D Although Verdana is better than Arial, nothing really beats courier. Would be nice if I could set that also for the other windows. "_j" (that's a 'J') doesn't really show very well. Lack of courier is my biggest gripe with the fsm editor as well btw.

Squint is a major help in finding errors - it found quite a few I must say I was shocked it was able to find (nice tracing through files) - but I think I will stick with UltraEdit for the main typing part. Then just switch back and forth to look for the "not so obvious"... Err, and the obvious. :)

[APS]Gnat
Aug 21 2010, 06:29
Lovely looking tool mate, but seems;
model.cfg
xxxx.rvmat
xxxx.hpp
xxxx.pbl
get no mention.

If I'm going to have a one-stop does-it-all text edit tool, it would be nice if it covered ALL files we addon makers play with in ArmAII/OA.
Sure, there very little syntax in model.cfg for example, but a basic C++ display helps with formating and finding those lost { " or ,

sbsmac
Aug 21 2010, 07:03
@<hidden>


Hey you forgot to tell that auto-complete detects locals now.

I'm sure I mentioned that in one of the earlier posts! Anyway, it detects _in_scope_ locals rather than all locals in the file (this is a deliberate feature). I think there is something a little odd about the very top file-level scope detection - need to check this.



However, it throws exceptions at me like a mad man again now. Try writing "net" on an empty line. I guarantee you are not allowed!.

Key not in dictionary error. Better catch that one .

Thanks - fixed :-)


@<hidden>
Could you check that 'CPP" grammar is being used (Right-click on the name of the file in the file-list and go to "select grammar->CPP" in the pop-up menu.

After you have done that, you will still see some errors:-

In your first example, squint doesn't like the lines like

sound[] = {\sound\s1a.ogg

since it thinks that \sound\s1a.ogg should be a number or variable name and therefore should not contain characters like '\' or '.'. Shouldn'tthis really be quoted...
"\sound\s1a.ogg" ?

To be honest I'm really amazed if arma does accept this as you have written it but I'm not an expert on configs so if you can confirm that this is really legal input I'll add support for it.

In your second example you've found a minor bug in the squint preprocessor which seems to be failing to remove the last line-continuation slash from the macro expansoion. :-) I'll look at this today but in the meantime you can fix those errors by removing the (unneeded) slash at the end of the macro definition.
BTW, why do people use '##' when they are not actually _pasting_ macro arguments ? "class ##x" in your example could just as well be written as "class x" !

@<hidden>


Well, sadly when it was all said and done I broke more than I could ever fix, it seems some things should not be in a private despite what Squint thinks,

No tool has yet been invented that can psychically deduce the intent of the original author and tell true errors from 'funny code' ! All squint can do is warn you of potential problems and recommend ways it might be fixed. Sometimes people have written scripts in the full knowledge that 'local' variables will always be present from the calling context so if you add a private statement then you will remove access to those variables which is probably what is happening in your case. Like I say, squint is a tool that can help you identify errors but it is unwise to go through your entire project blindly clicking 'fix' !



Also having problems with these comment examples:

Drat - there must be another way through the codepath I haven't fixed up. Thanks - will look at that. The indent/formatting for new private arrays is already in the issue tracker as a known bug. As Wass says, syntactically it makes no difference even if it looks ugly. Just be grateful you don't have to type those arrays by hand ! ;-)

@<hidden>


1) Auto-update without user control - huuuge no no from me. Had to block it on the firewall, which results in a very slow startup. Paranoia is a skill

Sorry but I have no plans to change this since it is hugely more convenient for me to know that all users are on the latest version. If you want to really paranoid you've probably failed at the first hurdle by installing an app from some guy you only know from some dodgy gaming forum ! :-P (J/k -squint does not contain any malware/viruses/spyware/rootkits or anything else!)


But mouse hoverover doesn't allow me to scroll other windows.

Sorry, dont understand what you mean here - can you explain ?


3) A little too helpful in trying to help me select things

Agreed - will turn off 'auto-word-selection' (or make it an option)



4) Would be nice to be able to set the white colors in the other windows to a user color as well. Especially now that I'm dead tired
5) I can't believe anyone is able to code without courier font Although Verdana is better than Arial, nothing really beats courier. Would be nice if I could set that also for the other windows. "_j" (that's a 'J') doesn't really show very well. Lack of courier is my biggest gripe with the fsm editor as well btw.

WIll consider adding settings for these.

@<hidden>


model.cfg
xxxx.rvmat
xxxx.hpp
xxxx.pbl

hpp is already supported

Could you send me or point me towards examples of the other formats ? Assuming that BIS haven't invented another grammar type for these, and have re-used cpp type structured grammar then support should be quite straightforward.

[APS]Gnat
Aug 21 2010, 08:11
Could you send me or point me towards examples of the other formats ?
Can do.

model.cfg


class CfgSkeletons
{
class default
{
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {};
};
class GNT_FSFBones: default
{
isDiscrete=1;
skeletonInherit = "";
skeletonBones[]=
{
"ZL1","",
"ZL2","",
"CL1","",
"CL2",""
};
};
};
class CfgModels
{
class Default
{
sectionsInherit="";
sections[] = {};
skeletonName = "";
};
class allvehicle : Default
{
sectionsInherit="";
sections[] = {};
skeletonName = "";
};
class Ship : allvehicle
{
sectionsInherit="";
sections[] = {"otocvez","otochlaven","radar","kompas","fuel","hodinova","minutova","mph","rpm","rpm2","main1turret","main1gun"};
skeletonName = "";
};
class GNTFSF : Ship
{
skeletonName = "GNT_FSFBones";
sectionsInherit = "Ship";
sections[] = {"ZL1","ZL2","CL1","CL2"};
class Animations
{
class ZL1
{
type="rotation";
initPhase=0;
source = "FUser1";
animPeriod=0.1;
sourceAddress = "clamp";
selection="ZL1";
axis="axis_swt";
minValue = 0;
maxValue = 1;
angle0=0;
angle1="rad -70";
};
class ZL2
{
type="rotation";
initPhase=0;
source = "FUser2";
animPeriod=0.1;
sourceAddress = "clamp";
selection="ZL2";
axis="axis_swt";
minValue = 0;
maxValue = 1;
angle0=0;
angle1="rad -70";
};
class CL1
{
type="rotation";
initPhase=0;
source = "FUser3";
animPeriod=0.1;
sourceAddress = "clamp";
selection="CL1";
axis="axis_swt";
minValue = 0;
maxValue = 1;
angle0=0;
angle1="rad -70";
};
class CL2
{
type="rotation";
initPhase=0;
source = "FUser4";
animPeriod=0.1;
sourceAddress = "clamp";
selection="CL2";
axis="axis_swt";
minValue = 0;
maxValue = 1;
angle0=0;
angle1="rad -70";
};

};

};

};


xxxx.rvmat


ambient[] = {1, 0.999529, 0.999529, 1};
diffuse[] = {1, 0.999529, 0.999529, 1};
forcedDiffuse[] = {0, 0, 0, 0};
emmisive[] = {0, 0, 0, 0};
specular[] = {0.523961, 0.523961, 0.523961, 0};
specularPower = 150;
PixelShaderID = "Super";
VertexShaderID = "Super";

class Stage1 {
texture = "ca\air_e\an2\data\an2_1_nohq.paa";
uvSource = "tex";

class uvTransform {
aside[] = {1, 0, 0};
up[] = {0, 1, 0};
dir[] = {0, 0, 0};
pos[] = {0, 0, 0};
};
};

class Stage2 {
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource = "tex";

class uvTransform {
aside[] = {1, 0, 0};
up[] = {0, 1, 0};
dir[] = {0, 0, 0};
pos[] = {0, 0, 0};
};
};

class Stage3 {
texture = "#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource = "tex";

class uvTransform {
aside[] = {1, 0, 0};
up[] = {0, 1, 0};
dir[] = {0, 0, 0};
pos[] = {0, 0, 0};
};
};

class Stage4 {
texture = "#(argb,8,8,3)color(1,1,1,1,AS)";
uvSource = "tex";

class uvTransform {
aside[] = {1, 0, 0};
up[] = {0, 1, 0};
dir[] = {0, 0, 0};
pos[] = {0, 0, 0};
};
};

class Stage5 {
texture = "ca\air_e\an2\data\an2_1_smdi.paa";
uvSource = "tex";

class uvTransform {
aside[] = {1, 0, 0};
up[] = {0, 1, 0};
dir[] = {0, 0, 0};
pos[] = {0, 0, 0};
};
};

class Stage6 {
texture = "#(ai,64,64,1)fresnel(0.36,0.53)";
uvSource = "tex";

class uvTransform {
aside[] = {1, 0, 0};
up[] = {0, 1, 0};
dir[] = {0, 0, 0};
pos[] = {0, 0, 0};
};
};

class Stage7 {
texture = "ca\data\env_land_co.paa";
uvSource = "tex";

class uvTransform {
aside[] = {1, 0, 0};
up[] = {0, 1, 0};
dir[] = {0, 0, 0};
pos[] = {0, 0, 0};
};
};

class StageTI {
texture = "ca\air_e\an2\data\an2_1_ti_ca.paa";
};


xxxx.pbl


class cfg
{
PNGfilename="terrain2.png";
squareSize=20;
originX=0;
originY=0;
minHeight=100;
maxHeight=1200;
};


layers.cfg


class Layers
{
class desertcliffs
{
texture = "gnt_sands\data\desertcliffs_detail_co.png";
material= "gnt_sands\data\desertcliffs.rvmat";
};
class desert1
{
texture = "gnt_sands\data\desert1_detail_co.png";
material= "gnt_sands\data\desert1.rvmat";
};
class desertrock3
{
texture = "gnt_sands\data\desertrock3_detail_co.png";
material= "gnt_sands\data\desertrock3.rvmat";
};
class deepdesert
{
texture = "gnt_sands\data\deepdesert_detail_co.png";
material= "gnt_sands\data\deepdesert.rvmat";
};

};

class Legend
{
picture= "gnt_sands\Source\mapLegend.png";
class Colors
{
/// color names should correspond to surface layer names
deepdesert[]= {{1,1,1}};
desert1[]= {{255,115,0}};
desertcliffs[]= {{255,0,0}};
desertrock3[]= {{0,0,255}};
}
};

sbsmac
Aug 21 2010, 08:27
Thanks. So they're all really just cpp files with a different extension ? That makes things pretty simple - will add support today.

Wass
Aug 21 2010, 09:02
@<hidden>
Could you check that 'CPP" grammar is being used (Right-click on the name of the file in the file-list and go to "select grammar->CPP" in the pop-up menu.

it set to CPP already



sound[] = {\sound\s1a.ogg

since it thinks that \sound\s1a.ogg should be a number or variable name and therefore should not contain characters like '\' or '.'. Shouldn'tthis really be quoted...
"\sound\s1a.ogg" ?

no,no.. "a" - its just a "end charter"...
that mean i can insert charter (numbers) after "s" and whan it over, string will close...
s1(close string charter) => s1, use \sound\s1.ogg
s2(close string charter) => s2, use \sound\s2.ogg
s3(close string charter) => s3, use \sound\s3.ogg
s4(close string charter) => s4, use \sound\s4.ogg
and something like this...



To be honest I'm really amazed if arma does accept this as you have written it but I'm not an expert on configs so if you can confirm that this is really legal input I'll add support for it.

Yes, this is good way create cpp syntax without unnessesary typing :)
I can show you more examples if you need it.




In your second example you've found a minor bug in the squint preprocessor which seems to be failing to remove the last line-continuation slash from the macro expansoion. :-) I'll look at this today but in the meantime you can fix those errors by removing the (unneeded) slash at the end of the macro definition.

btw, its *.hpp file which call from description.ext by
#include "Titles\id.hpp"



BTW, why do people use '##' when they are not actually _pasting_ macro arguments ? "class ##x" in your example could just as well be written as "class x" !


no, "x" - close charter, but i use a different names here, like
Boevik, Pl1-Pl5, Pilotvt, cop, drv...

sorry, my english is bad :)
so i trying type simple words :)

sbsmac
Aug 21 2010, 09:46
sorry, my english is bad
so i trying type simple words

No problem - though it took me a while to work out you mean 'character' when you said 'charter' :)

Sorry - the 'a' in sound[] = {\sound\s1a.ogg was a cut-and-paste mistake by me. What I was really asking was why (when you look in preprocessed view)


sound[] = {\sound\s1.ogg, ...

was not

sound[] = {"\sound\s1.ogg", ...

Alternatively, why not use macros like this...




#define QUOTEPATH(X) #X
#define s(A) \
class s##A \
{ \
name = "sound"; \
sound[] = {QUOTEPATH(\sound\s##A.ogg), db+0, 1.0}; \
titles[] = {0, $STR_s##A}; \
}; \

class CfgSounds
{
sounds[] = {};
s(1);
etc


Anyway, if you say that unquoted paths are legal in cpp files I'll need to look at supporting them. :)




Originally Posted by sbsmac View Post
BTW, why do people use '##' when they are not actually _pasting_ macro arguments ? "class ##x" in your example could just as well be written as "class x" !

no, "x" - close charter, but i use a different names here, like
Boevik, Pl1-Pl5, Pilotvt, cop, drv...


Understood, but what I meant was that there is no difference between

#define M(X) ##X

and

#define M(X) X

'##' is just a 'token-pasting' operator - if there's nothing for it to paste on the left-hand side then you might as well leave it out ! :)

Wass
Aug 21 2010, 10:03
Alternatively, why not use macros like this...


oh, i see.
i newer use way like this, actually, im not expert :)



Anyway, if you say that unquoted paths are legal in cpp files I'll need to look at supporting them. :)


good to hear :)



Understood, but what I meant was that there is no difference between

#define M(X) ##X

and

#define M(X) X

'##' is just a 'token-pasting' operator - if there's nothing for it to paste on the left-hand side then you might as well leave it out ! :)

sure :)


This metod work in *.bikb files to
here is example use



class Sentences
{
#define TEXT(I,N) \
class Player_##I##_##N \
{ \
text = $STR_Player_##I##_##N##; \
speech[] = {\sound\PLAYER\Player_##I##_##N##.ogg}; \
class Arguments {}; \
};

TEXT(Tr1,1)
TEXT(Tr2,1)
TEXT(Tr2,2)
TEXT(Tr2,3)
TEXT(Tr1,01)
TEXT(Tr1,02)
TEXT(Tr1,03)
TEXT(Tr1,04)
TEXT(Tr1,05)
TEXT(Tr1,06)
TEXT(Vid1,1)
TEXT(Vid1,2)
TEXT(Vid1,3)
TEXT(Vid2,1)
TEXT(Vid2,2)
};


class Arguments{};
class Special{};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};




we can use some names for sound



class CfgSounds
{
sounds[] = {};
#define Tarasov(a) \
class Tarasov##a \
{ \
name = "sound"; \
sound[] = {Tarasov##a.ogg, db+0, 1.0}; \
titles[] = {0, $STR_Tarasov##a}; \
}; \

Tarasov(1);
Tarasov(2);
Tarasov(3);

#define Kopitkin(b) \
class Kopitkin##b \
{ \
name = "sound"; \
sound[] = {Kopitkin##b.ogg, db+0, 1.0}; \
titles[] = {0, $STR_Kopitkin##b}; \
}; \

Kopitkin(1);
Kopitkin(2);
Kopitkin(3);
};



for exampe - here is my cfgSound from description.ext




class CfgSounds
{
sounds[] = {};


#define s(a) \
class s##a \
{ \
name = "sound"; \
sound[] = {\sound\s##a.ogg, db+0, 1.0}; \
titles[] = {0, $STR_s##a}; \
}; \

s(1);
s(2);
s(3);
s(4);
s(5);
s(6);

#define beep(b) \
class beep##b \
{ \
name = "sound"; \
sound[] = {\sound\beep##b.ogg, db+0, 1.0}; \
titles[] = {}; \
}; \

beep(1);
beep(2);
beep(3);





#define intro(c) \
class intro##c \
{ \
name = "sound"; \
sound[] = {\sound\intro\intro##c.ogg, db+0, 1.0}; \
titles[] = {0, $STR_intro##c}; \
}; \

intro(1);
intro(2);
intro(3);
intro(4);
intro(5);
intro(6);
intro(7);
intro(8);
intro(9);
intro(10);
intro(11);
intro(12);
intro(13);
intro(14);
intro(15);
intro(16);
intro(17);

class mi24
{
name = "mi24";
sound[] = {"\sound\mi24.ogg", db-6, 1.0};
titles[] = {};
};

class Video_2_9
{
name = "Video_2_9";
sound[] = {"\sound\JACKAL\Video_2_9.ogg", db-6, 1.0};
titles[] = {0, $STR_Video_2_9};
};

class Video_2_10
{
name = "Video_2_10";
sound[] = {"\sound\JACKAL\Video_2_10.ogg", db-6, 1.0};
titles[] = {0, $STR_Video_2_10};
};

class Player_Vid2_1
{
name = "Player_Vid2_1";
sound[] = {"\sound\PLAYER\Player_Vid2_1.ogg", db-6, 1.0};
titles[] = {0, $STR_Player_Vid2_1};
};
class Player_Vid2_2
{
name = "Player_Vid2_1";
sound[] = {"\sound\PLAYER\Player_Vid2_2.ogg", db-6, 1.0};
titles[] = {0, $STR_Player_Vid2_2};
};

};




btw, we can set sound parametrs



class CfgSounds
{
sounds[] = {};
#define zvuk(x, ImyaZvuka, OggZvuka, perem1, perem2, ImyaStringa)\
class ##x \
{\
name = ##ImyaZvuka;\
sound[] = {##OggZvuka, db + ##perem1, ##perem2};\
titles[] = {0, $##ImyaStringa}; \
};\

zvuk(sound1, Sound1, "sound1.ogg", 1, 0, STR_sound1)
zvuk(sound2, Sound2, "sound2.ogg", 1, 0, STR_sound2)
zvuk(sound3, Sound3, "sound3.ogg", 1, 0, STR_sound3)

sbsmac
Aug 21 2010, 10:14
Sure, but the last one would work exactly the same if you just wrote...


class CfgSounds
{
sounds[] = {};
#define zvuk(x, ImyaZvuka, OggZvuka, perem1, perem2, ImyaStringa)\
class x \
{\
name = ImyaZvuka;\
sound[] = {OggZvuka, db + perem1, perem2};\
titles[] = {0, $##ImyaStringa}; \
};\

zvuk(sound1, Sound1, "sound1.ogg", 1, 0, STR_sound1)
zvuk(sound2, Sound2, "sound2.ogg", 1, 0, STR_sound2)
zvuk(sound3, Sound3, "sound3.ogg", 1, 0, STR_sound3)


since macro argument substitutions are carried out before pasting :)

Wass
Aug 21 2010, 10:18
its just a sample... from our forum.
i never use it, write my self for my missions, just base on it.

I very grateful to our scripter, Lost [OTK Team] who teach us this method :)

Li0n
Aug 21 2010, 10:52
sbsmac
http://imagepost.ru/images/196/Clipboard01.gif
What I`ve done wrong?

sbsmac
Aug 21 2010, 11:14
That doesn't look like the squint setup utility to me. The fact that the 'Cancel' button is labelled 'Chancel' looks very odd. Are you sure you're setup.exe hasn't been tampered with?

CarlGustaffa
Aug 21 2010, 14:14
Sorry but I have no plans to change this since it is hugely more convenient for me to know that all users are on the latest version. If you want to really paranoid you've probably failed at the first hurdle by installing an app from some guy you only know from some dodgy gaming forum ! :-P (J/k -squint does not contain any malware/viruses/spyware/rootkits or anything else!)

And what if it autoupdates a hacked version? No, I'm gonna stick to my paranoia and not allow it access. I just can't do it - update on demand ftw :D No worries though, I'll keep it updated.

sbsmac
Aug 21 2010, 14:41
I don't claim to be a security expert but since the manifest files are signed, it is not practical to 'spoof' an update with a hacked version. Your biggest risk is that I suffer some kind of mental breakdown in the future and issue a new update which does "bad things" (TM). (Ironically this is far more likely to happen if I get stressed that people are reporting bugs against obsolete versions :-P ) In fact, in that regard, clickonce is more secure than the kinds of updates you get from most other places (including BIS - I'd suggest that anyone who really had it in for the arma community would simply spoof the beta download site rather that worrying about my little project!)

But don't just take my word for it, here's an official msdn blog saying much the same thing...



WRT to the spoofing scenario the gentlemen speaks to on your blog, the spoofer would need to have control of not only the server the application came from, but the keys with which it was orignally signed (all clickonce apps are signed with strong names for exactly this reason). You can't insert yourself in the middle and cause an application to update when it shouldn't. Security has definitely been a major priority with this technology.

http://blogs.msdn.com/b/tims/archive/2004/05/22/139526.aspx

All that said, I'll probably take a look at making the autoupdate a little more configurable in future - it'll never stop nagging you but you may be able to postpone the actual update for a while. :)

gunterlund21
Aug 21 2010, 14:57
earlier you mentioned it supports hpp files. I dont see a way to select one.
I see sqf
pbo, and config files and that is it.

Li0n
Aug 21 2010, 14:57
That doesn't look like the squint setup utility to me. The fact that the 'Cancel' button is labelled 'Chancel' looks very odd. Are you sure you're setup.exe hasn't been tampered with?
I`ve downloaded setup.exe from devheaven by the link in the first post. Sorry for mistake in the word. It was replaced by me. There was the same word but in russian. Do you need version with russian word?

Muzzleflash
Aug 21 2010, 15:10
#define __Push(avar,theval) avar set [count avar, theval];

Underlining "Other" can make macro's harder to read. Most people, like me, probably use a specific number of underscore before and it is not a big problem. However, just want to bring this to your attention.

#define __Push(avar,theval) avar set [count avar, theval];

---------- Post added at 17:10 ---------- Previous post was at 17:04 ----------

Another issue with the auto-complete:
I have to locals in same scope: _targets and _targetZone.
It only outputs the top one unless I make it deduce down to only one. What I mean is as long as I have multiple possibles the top one is chosen no matter which one I select using the arrowkeys.

Writing _tar gives me (in the auto complete box):
_targets
_targetZone
Upon select _targetZone and pressing enter _targets get written instead.

And upon using autocompletion the Enter keypress is not intercepted.

sbsmac
Aug 21 2010, 15:16
@<hidden>

The hpp filter is missing from the file/add to project menu. I'll add it but for now you can easily add hpp files by dragging them from the desktop and dropping them into the file-list. (You can also drag entire folders or pbos).

@<hidden> - sorry, I'm at a loss. Despite a fair amount of googling I'm unable to find anyone who has reported a similar problem :-(

@<hidden> The underlining actually represents 'folded' text. (The FAQ (https://sites.google.com/site/macsarmatools/squint/faq)explains a bit more about this.) Looks like making this a bit more configurable would be a good option in the future though.

---------- Post added at 04:16 PM ---------- Previous post was at 04:13 PM ----------

Grrr - must have broken the normal auto-completion whilst hurrying to get the tab-completion working last night. Will fix later, in the middle of a major new feature atm.

Muzzleflash
Aug 21 2010, 15:36
Ahh folded text. Now it makes sense. Also clears up my confusion to why other, "other" text like numbers weren't underlined. I have no isues with it now that I know why.

Question:

if (isNil "_ammobox") exitWith {};
Here "_ammobox" does not get same colour as string, however it get's same color as local variable. Intended?

sbsmac
Aug 21 2010, 16:05
Yep, because the analyser recognises that quoted strings after 'isNil', 'private' or 'for' represent the names of variables :) Amongst other things this allows squint to figure out that you have referenced the _ammobox variable in that statement even though you might not have used it elsewhere.

Muzzleflash
Aug 21 2010, 16:10
Cool. I'm trying to convert to squint for my project editing. However, it did not import my (de)briefing.sqf file :S.

sbsmac
Aug 21 2010, 16:12
Can you give more details or link to the file ?

Muzzleflash
Aug 21 2010, 16:29
Oh.. I'm sorry I wrote that completely wrong. :o

It is more for the editor aspect of Squint. It is the briefing.html file, it does not get loaded even for editing. Don't know if "non-analysable" can even be made to be opened in squint?

sbsmac
Aug 21 2010, 22:26
Just fixed (I hope) the auto-complete problem (forgot to comment out some debug code).

The 'major new feature' isn't quite finished yet but I've made a release anyway....

The following file extensions are now supported (through drag and drop):

*.sqf;*.h;*.ext;*.sqm;*.cpp;*.hpp;*.rvmat;*.bin;*.cfg;*.pbl"

If you drag a binarised file into squint, it will automatically show you the contents as text so you can edit them.

If you drag a pbo fle into squint, it will open all files with the pbo that match these file extensions. If any of those files are binarised, they will be unbinarised and presented as text.

To give an idea, here's what you see if you drag wheeled3.pbo into squint...

http://www.armaleague.com/mac/misc/unbin.PNG

Note the rvmat files inside the pbo have been unbinned so you can view (and edit) them as text.

You can't yet save binarised files I'm afraid- was hoping to get it working today but there are a few wrinkles in the interaction with the grammar analysis. That should be working soon. In the meantime, since I'm not an addon expert by any stretch of the imagination, please feel free to let me know if you think the unbinning/cpp-analysis is any more broken than has already been reported.

Tankbuster
Aug 21 2010, 22:30
What's the best way of getting Squint to look over the contents of a file I have on the clipboard?

sbsmac
Aug 21 2010, 22:32
Just CTRL-V it into the **scratch** window?

Tankbuster
Aug 21 2010, 22:42
Ah yes. Thank you.

NoBrainer
Aug 21 2010, 23:11
I think it would be great if you at least add an "default" button to the "Fonts and Colors" settings. So when I F**** up I can revert it...

:j:

And if you might add line numbers, it would be easier for me to find on which line I have made my errors. because I do make a lot of errors...

Also, some times I just want to start fresh. A "close project" would be nice.

From ArmA Edit I'm used to tabs. Is that something your considering?

Otherwise this is a great tool!

Soul_Assassin
Aug 21 2010, 23:38
at Li0n:

free up some space on your harddrive! The installation comes with .NET redistribution so it needs alot of space.

callihn
Aug 22 2010, 06:20
it does not matter, because charter ";" here. It saparate commands in line.

If it "didn't matter" then:

A. there would be no tab and no enter on my keyboard.

AND

B. I wouldn't have mentioned it.

We don't go through the trouble of using tab and multiple lines of code to have it jammed up on a single line later on by an automated process, or at least me and the mouse in my pocket don't. ;)

And yea the false postives cause problems for those that are unsure.

Anyway, one of the biggest issues I noticed was it trying to use too many privates in fact breaking longer script files because the varible was unable to pass to the next funtion. I think I said that right. I know, I know, I read what you said, however I thought I was baby sitting it, apparently it out smarted itself and me, but of course I had backups, just thought I would ask if it could be made smarter in those regards.

Tankbuster
Aug 22 2010, 07:24
I think it would be great if you at least add an "default" button to the "Fonts and Colors" settings. So when I F**** up I can revert it...

:j:

And if you might add line numbers, it would be easier for me to find on which line I have made my errors. because I do make a lot of errors...

Also, some times I just want to start fresh. A "close project" would be nice.

From ArmA Edit I'm used to tabs. Is that something your considering?

Otherwise this is a great tool!

All great points, especially the line numbers bit.

sbsmac
Aug 22 2010, 08:19
Yes good suggestions and the multiple tabs for files is something I've been considering.
OTOH there's no effective difference between multiple tabs and the current system except that
1) you would click on the tab rather than the file in the file-list (might make selection of 'interesting' files a bit quicker).
2) The cursor and scroll position would be remembered for files (though I could add that to the current design)
Or am I missing something fundamental ?

Line numbers... yes although for various technical reasons, reconsituting line-numbers after the text has been through the preprocessor is a bit of pain. In the meantime are you aware that highlighing an error in the errror-list (or pressing ALT-UP or ALT-DOWN in the code-window) or pressing these buttons...
http://www.armaleague.com/mac/squint/toolbarbuttons/NextError.png
http://www.armaleague.com/mac/squint/toolbarbuttons/PrevError.png
will highlight the (approximate) position of the error in the code-window ? Often this highlighting is even more accurate than giving a line-number.

There is a full list of keyboard shortcuts, menu options, toolbar icons etc at https://sites.google.com/site/macsarmatools/squint/command-reference

"Close project" as you describe it is already implemented as "new project" which is this icon
http://www.armaleague.com/mac/squint/toolbarbuttons/NewProject.png
It clears the file-list (after warning you whether you have unsaved work) and lets you 'start again'.


@<hidden>

I think what wass meant was that syntactically the indentation is irrelevant. Of course it would be nice if squint was smart enough to use the 'right' indentation but rather than taking the'glass half-empty' view you might want to consider the large amount of typing this can save you when writing code from scratch. :)
As I've already said, the 'false-positives' are just warnings that you need to look more closely at the code is structured - unfortunately no tool can remove the requirement for human intelligence and experience. :)

callihn
Aug 22 2010, 08:55
Of course it would be nice if squint was smart enough to use the 'right' indentation but rather than taking the'glass half-empty' view you might want to consider the large amount of typing this can save you when writing code from scratch. :)

Actually I was looking at it from 98% full.

Maybe it just needs a dumbass mode, what do you want me to say?

Hell I and others apparently didn't know when and when not to use the privates to begin with.

sbsmac
Aug 22 2010, 09:05
:) Well, I'm genuinely interested in getting ideas about how the tool and output can be made easier to use and understand. Some of the error messages are a bit cryptic and though I've made an attempt an explaining some of them at https://sites.google.com/site/macsarmatools/squint/errors this could probably be improved.

If people want to suggest text to add to the documentation or errors/warnings that could be better explained I'd welcome it with open arms! Perhaps someone out there even fancies putting together some more tutorial presentations/videos? ;-)

Tankbuster
Aug 22 2010, 09:06
The thing about line numbers is that it helps me collaborate. If I'm looking at the file in Squint and I see it's picked up an error (or maybe a false positive) I can discuss it live in comms with my team and that's much easier if I can give them a line number.

When asking for line numbers, I hadn't considered the pre and post process thing. But thinking about it, post process errors and CTDs often quote a post process line number. Tracking that down in a file full of includes is a black art I've yet to master, but it's clear, to me at least there is potential benefit. I realise now, of course, the issues with having the application show post process line numbers.

sbsmac
Aug 22 2010, 09:15
Understood about the line numbers - I think the best thing is if I think about some way to allow you to get hold of the line-numbers both in 'source' view (those will always be relative to the current file) but also it may be possible to figure out the line-number relative to beginning of the current included file when in preprocessed view.

---------- Post added at 10:15 AM ---------- Previous post was at 10:12 AM ----------


But thinking about it, post process errors and CTDs often quote a post process line number. Tracking that down in a file full of includes is a black art I've yet to master

Actually the numbers you see are character indices into the post-processed output (whether you are in source or preprocessed view). The best way to track down CTF type errors for now is simply to switch to the preprocessed view and use next/prev error to highlight the one you are interested it. It's still a bit confusing knowing which incude file you are inside but at least you can see the code causing the problem.

CarlGustaffa
Aug 22 2010, 09:54
How about doing it like UltraEdit? Have a separate narrow window to the left of the source view that contains the line numbers. But unlike UltraEdit, don't number lines of preprocessor commands. No rush though, but maybe some day :)

[sbs]Karlos
Aug 22 2010, 10:17
Can I just remind everyone that mac belongs to SBS. He's signed a contract for life and no one is allowed to have him. :D

good stuff mac!

sbsmac
Aug 22 2010, 10:25
Oh no, now I'm trouble! Forgot to get a permission-slip from taxman before going awol for my little 'holiday project' :j:

CarlGustaffa
Aug 22 2010, 10:56
Hehe :) Well, I have my own little "holiday project". Lets just say I didn't get a tan this yes... Either :o

Tophe
Aug 22 2010, 14:58
This is amazing stuff! The best scripthelper created over the last 10 years. Love it!

Only problem I find is that it would so much better if you just released it as a .exe or made a standard installer that installs the program at a chosen path.
Instead of C:\Users\MyName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Mac's Tools\

This way one could associate the program with the appropriate files.

Other than that.. Amazing stuff!

sbsmac
Aug 22 2010, 15:10
Thank you indeed - I had a good chuckle listening again to "song for bohemia". If you ever write one for squint it should probably contain the line "any colour you want as long as it's black" ;-)


I've already talked a lot about why I feel ClickOnce is a good choice for me but the ability to associate files is definitely an interesting point. I'll look at the possibility of adding some shell extensions (actually Tankbuster raised this some time ago on the official issue-tracker so it's on the 'todo' list).

sbsmac
Aug 22 2010, 19:50
Ok, don't say I don't ever listen ;-) Line numbers are in. I won't bore you with how many hours I wasted before discovering that rich-text simply can't handle non-integer sized fonts, just hope you like the end result....

http://www.armaleague.com/mac/misc/linenumbers.PNG

I had to rewrite the way zooming of text-boxes works in order to get this going properly. If you are in the habit of using CTRL-mousewheel to zoom in and out you will probably find your codewindow textsize has reset itself when you restart.

Wass
Aug 23 2010, 04:55
Mouse whell dont work in "text" window. If i click by whell in window, i can list it moving mouse, but when i simple rotate whell after click LMB or RMB - there is no reaction.

You didnt fix my ask about #define?

callihn
Aug 23 2010, 06:26
Here is something I found to appear correct though it does not evaluate as I expected, maybe it is something you can work with.


if ((_empty && _moved || _disabled || !(alive _vehicle)))

Does not work the same as:


if ((_empty && _moved) || (_empty && _disabled) || (_empty && !(alive _vehicle)))

Empty is ignored in the first example.

However this does work:


if ((_empty && (_moved || _disabled || !(alive _vehicle)))) then {

JamesF1
Aug 23 2010, 08:15
First off, fantastic application. Many thanks!


Mouse whell dont work in "text" window. If i click by whell in window, i can list it moving mouse, but when i simple rotate whell after click LMB or RMB - there is no reaction.
I think I'm making the same point... scrolling with the mouse-wheel in the text window doesn't work in this version (can't recall if it did before or not... have only spent 5 minutes with the program thus far :)).

Also, is there any way to exempt certain functions from erroring? E.g. Some of the compiled BIS functions show up as errors (e.g. BIS_fnc_spawnVehicle)... and also, obviously, things like CBA functions (e.g. CBA_fnc_globalExecute).

sbsmac
Aug 23 2010, 08:31
Wass- thanks for the report about the mouse-wheel. Will put this back in today. I'm afrad I haven't added support for 'bare' filenames yet. It is on the list (http://dev-heaven.net/issues/13134#change-63583) but there is quite a lot of other stuff there as well so it may take some time :)


Callihn. Sorry but if I've misunderstood but I think you are suggesting that squint could be warning of something like "this expression may not evaluate as you expect, use more brackets" when it sees....


_empty && _moved || _disabled || !(alive _vehicle)
?

This is a good suggestion. It already does this for some 'tricky' operators and I'll think about how to apply it in the above circumstances. In the meantime, it may help you to know that Arma will evaluate operators of equal precedence in order from left to right. So this will be treated as


( (_empty && _moved) ||
_disabled )
|| !(alive _vehicle)
(Ironically the one place that brackets are used in the original statement, around the "alive vehicle", they are not required.)

You can check on how squint thinks arma will evaluate your expressions by moving the mouse over an operator (eg the first '&&') and right-clicking to bring up the pop-up menu. Then choose 'highlight operands' and in this case you will see that the '&&' only
works on _empty and _moved. If you do the same with the first '||' you will see that "_empty && _moved" is treated as the first operand and "_disabled" as the second for that "||" etc...

---------- Post added at 09:31 AM ---------- Previous post was at 09:24 AM ----------

JamesF1, no, mouse-wheeling was broken yesterday when I added line-numbers (technical digression.... there was a major problem getting line-numbers to line-up corrrectly with the text in the code-window, for some reason different-size fonts were being used in the two windows. After much hair-pulling I deduced that non-integer font sizes were being rounded up in the rendering path for the code window. Easiest way to fix this was to disable mouse-zoom and use some custom code to scale the fonts instead. But I forgot to add support for basic scroll back in !)

>Also, is there any way to exempt certain functions from erroring?

Yes, this is a known problem and easy to fix - I just need to get to my 'main' PC for a few hours to compile a list of the BIS functions. Will also talk to sickboy about getting a list from CBA.

CarlGustaffa
Aug 23 2010, 08:35
scrolling with the mouse-wheel in the text window doesn't work in this version (can't recall if it did before or not... have only spent 5 minutes with the program thus far :)).

It did before, but you still had to click in the window. Would be nice if the app could recognize which part the mouse was over and scroll that window without actually having to click. Easy to "miss" the location you were typing in by accidentally clicking somewhere else.

JamesF1
Aug 23 2010, 08:35
JamesF1, no, mouse-wheeling was broken yesterday when I added line-numbers (technical digression.... there was a major problem getting line-numbers to line-up corrrectly with the text in the code-window, for some reason different-size fonts were being used in the two windows. After much hair-pulling I deduced that non-integer font sizes were being rounded up in the rendering path for the code window. Easiest way to fix this was to disable mouse-zoom and use some custom code to scale the fonts instead. But I forgot to add support for basic scroll back in !)
Fair enough :)


Yes, this is a known problem and easy to fix - I just need to get to my 'main' PC for a few hours to compile a list of the BIS functions. Will also talk to sickboy about getting a list from CBA.
If it helps, you can also use BIS_fnc_help when running A2 to get a list of the CBA functions (I'm sure you already knew that, though)... alternatively, the command reference for CBA (http://dev-heaven.net/docs/cba/index/General.html) lists everything.

callihn
Aug 23 2010, 08:41
Callihn. Sorry but if I've misunderstood but I think you are suggesting that squint could be warning of something like "this expression may not evaluate as you expect, use more brackets" when it sees....



_empty && _moved || _disabled || !(alive _vehicle)

?

This is a good suggestion. It already does this for some 'tricky' operators and I'll think about how to apply it in the above circumstances. In the meantime, it may help you to know that Arma will evaluate operators of equal precedence in order from left to right. So this will be treated as


( (_empty && _moved) ||
_disabled )
|| !(alive _vehicle)

(Ironically the one place that brackets are used in the original statement, around the "alive vehicle", they are not required.)


Yea, that was the thought I was having and strangely enough it treated it as:

( (__moved || _disabled || !alive _vehicle))

It didn't care if it was empty or not, real fun taking off in a jet when it kicked in. ;)

sbsmac
Aug 23 2010, 08:54
alternatively, the command reference for CBA lists everything.

That's very useful, thank you!

JamesF1
Aug 23 2010, 09:03
As a minor additional point, the tooltip for the button left of "Reload all Files" (what I can only presume to be "Reload this File") has the default tooltip "toolStripButton18".

sbsmac
Aug 23 2010, 09:04
TY - good catch :)

callihn
Aug 23 2010, 10:52
Even stranger is that in the other two code examples, it only seems to care about empty as if I watch carefully vehicles which have not been moved nor damaged start respawning, maybe I've set the movement too sensitive at > 0, I dunno. Anyway, so I guess I'll be sorting that out. :eek:

Also now when I hit the get help for errors it no longer opens that web page.

sbsmac
Aug 23 2010, 11:13
Also now when I hit the get help for errors it no longer opens that web page. ]

Hmm - the toolbar button works but I must have forgotten to wire up the items in the help menu - will be fixed in next release.

JamesF1
Aug 23 2010, 11:46
Right, really delving into this application now. One bug to mention: when the application inserts 'private' declarations, the new-line is in the wrong place, e.g. you end up with:


private ["_myvar"];hint "Peanuts";
Instead of:

private ["_myvar"];
hint "Peanuts";

Also, I have a couple of 'requests' - don't know how many of these have been suggested before, or that you've planned, or that you've ruled out already. None of them are 'critical' but they are things I'd love to see at some point :)

Fonts & Colours

"Real-time" preview of the colour/font changes
Support for OpenType fonts (as an example, I love Inconsolata (http://www.levien.com/type/myfonts/inconsolata.html) as a programming font, and use it exclusively).
Enable customisation of the entire styling of each type (e.g. I dislike the italics on comments).
Increase the styling options to the project and error panels, too.
Allow export and import of font/colour sets (a lá Visual Studio), to allow us to share good configurations (or to move them between installs, etc).


Other Areas

Small documentation snippet on hover (e.g. maybe including the "Syntax", "Description" [max. 150 chars or so] and "Return Value" fields from the Biki for known commands).
Option to set a 'working directory' for a project, so project paths (in the left-hand panel) are relative to the working directory rather than absolute.
Search & Replace


I'm sure I'll come up with more over time (I'm sure you're thrilled at that prospect :p :o).

sbsmac
Aug 23 2010, 13:33
JamesF1,

The private indentation has been mentioned a few times by other people. It's mildly annoying but actually quite hard to fix (grammar analyser does not have access to formatting info and only operates on a stream of expressions which has whitespace discarded). Bug at http://dev-heaven.net/issues/12934


* "Real-time" preview of the colour/font changes
Enable customisation of the entire styling of each type (e.g. I dislike the italics on comments).
* Increase the styling options to the project and error panels, too.
* Allow export and import of font/colour sets (a lá Visual Studio), to allow us to share good configurations (or to move them between installs, etc).


Interesting side-note. When I first started writing squint it was with the intention of making a CLI backend static-analyser. Soon realising that 90% of scripters would not understand or use such a tool I decided to add a rudimentary gui and basic editing capability so people could fix the problems it found a bit more easily. Now I'm hoist by my own petard (yes, I did rather ask for this by advertising squint as an 'editor') and people keep asking for the GUI to be improved to the standards of a professional editing suite. ;)

Anyway all good suggestions and added as http://dev-heaven.net/issues/13205



* Support for OpenType fonts (as an example, I love Inconsolata as a programming font, and use it exclusively).
*

I use a standard FontDialog and according to the documentation it should offer any OpenType fonts you have installed. If you have any ideas let me know -I'm not much of font expert!



* Small documentation snippet on hover (e.g. maybe including the "Syntax", "Description" [max. 150 chars or so] and "Return Value" fields from the Biki for known commands).

Yep good idea - http://dev-heaven.net/issues/13206


* Option to set a 'working directory' for a project, so project paths (in the left-hand panel) are relative to the working directory rather than absolute.


The whole file-list concept needs rethinking wrt paths, especially since you can create a project from a pbo and edit files within it (even binarised files within a pbo). I have some vague ideas that involve treeviews... http://dev-heaven.net/issues/13207



* Search & Replace

There's already search but I agree S&R woudl be good, even global S&R. There's already a 'refactor' suggestion at http://dev-heaven.net/issues/12589


I'm sure I'll come up with more over time (I'm sure you're thrilled at that prospect ).

Actually the worst thing for a developer is lack of feedback and suggestions show that people think the product is good enough to be improved so whilst I may sometimes sigh inwardly when I see yet another request to change the default background colour from black (!) , really I appreciate the fact people are using the tool. :)

On a practical matter, I'm starting to drown in a long list of helpful suggestions and bug-reports (as well as the nice comments which are always appreciated!). I'll always do my best to 'scrape' these from this forum but those of you who are willing to take 5 minutes to register at http://dev-heaven.net/ can help me a lot by opening tickets on the official issue-tracker for squint (http://dev-heaven.net/projects/squint/issues).

You don't even have to remember this link:- there is a 'Bug reporting' menu which offers the useful option to 'report bug'. When you do this the contents of the code window as well as details of any error in your code are copied to the clipboard and your browser is opened to the issue tracker where you can paste them in if relevant ! :)

Muzzleflash
Aug 23 2010, 13:55
On a practical matter, I'm starting to drown in a long list of helpful suggestions and bug-reports (as well as the nice comments which are always appreciated!). I'll always do my best to 'scrape' these from this forum but those of you who are willing to take 5 minutes to register at http://dev-heaven.net/ can help me a lot by opening tickets on the official issue-tracker for squint (http://dev-heaven.net/projects/squint/issues).
It just won't let me. Changed my password 50 times now and I still cannot login. Yes I am using the correct username. I officially declare dev-heaven evil and discriminating against me'es.

Nevermind created a user with same name and got it worked :rolleyes:

Nevermind the nevermind, won't let me login again now... sigh...

JamesF1
Aug 23 2010, 13:57
Anyway all good suggestions and added as http://dev-heaven.net/issues/13205
I'll post 'em on Dev-Heaven in future, for you :)


I use a standard FontDialog and according to the documentation it should offer any OpenType fonts you have installed. If you have any ideas let me know -I'm not much of font expert!
I'm not really familiar with the FontDialog, as I have rarely had use for it in the majority of .NET work I've done... but when trying to load any OpenType font, I get an unhandled exception saying it only takes TrueType fonts.


There's already a 'refactor' suggestion at http://dev-heaven.net/issues/12589
Looks good to me :)


Actually the worst thing for a developer is lack of feedback and suggestions show that people think the product is good enough to be improved so whilst I may sometimes sigh inwardly when I see yet another request to change the default background colour from black (!) , really I appreciate the fact people are using the tool. :)
I know the feeling well - the outright worst situation, for me at least, is criticism of your software without any form of constructive input!


On a practical matter, I'm starting to drown in a long list of helpful suggestions and bug-reports (as well as the nice comments which are always appreciated!).
If you ever feel like 'outsourcing' a few parts to others (such as those not so tied up in the lexer, or such), I'm sure there are a number of people around who have experience with .NET (myself included) who could contribute in some way... even if it's just research-related. :) Personally, I couldn't promise much time, but well, the offer's there.

sbsmac
Aug 23 2010, 14:13
Very strange - I can only suggest you contact sickboy or one of the admins to figure out what is going on there :-(


In the meantime 1.0.0.82 is released with the following fixes...

*Bug #12897: Bug reporting should not prompt for a switch to preprocessed view. (http://dev-heaven.net/issues/12897)

*Bug #13202: tooltip for "reload current file" missing (http://dev-heaven.net/issues/13202)

*Bug #13203: settings/paths and colours should take affect immediately (http://dev-heaven.net/issues/13203)

*Bug #13208: Menu items for "Show command reference" and "help on errors" did not work (http://dev-heaven.net/issues/13208)

Tankbuster
Aug 23 2010, 14:13
[shameless bump of my own DH ticket (http://dev-heaven.net/issues/12601)]
Is there any chance we might get shell integration? It would be ever so cool to right click on a file in explorer and have it sent straight to Squint.

Muzzleflash
Aug 23 2010, 14:29
Linenumbers should display at least 3 digits.

Using courier new only 2 digits are visible. Could not find a way to resize that line number area.

sbsmac
Aug 23 2010, 14:49
<cough> try scrolling down to line 100 ;)

Muzzleflash
Aug 23 2010, 14:51
Weird I must have scrolled down on line numbers cause pretty sure I saw the strange version. Well as long as it works when you scroll right :).

sbsmac
Aug 23 2010, 15:10
Ah, now the fact you can scroll in the line-number window and break the synchronisation between that and the code-window is a bug ! :)

http://dev-heaven.net/issues/13210

sbsmac
Aug 23 2010, 19:31
1.0.0.86 now out.

*Bug #13212: 82 - Not possible to disable pp view via the menu or ALT+9 (http://dev-heaven.net/issues/13212)
*Bug #13213: Much reduced flicker when using ALT up and down to scroll through errors (http://dev-heaven.net/issues/13213)
*Bug #13214: HIghlighted error in error-list could be out of view when using ALT-up.down to scroll (http://dev-heaven.net/issues/13214)
*Bug #13215: Highlighted error in codewindow is now placed 5 lines down from top of screen when using ALT-up/down selection (http://dev-heaven.net/issues/13215)
*Feature #12879: Add undo capability to code-window (http://dev-heaven.net/issues/12879) (CTRL-Z or ALT-BACKSPACE)

Especially for Tankbuster...:)
*Feature #12601: Shell integration (http://dev-heaven.net/issues/12601)

Instructions on how to set this up are here (https://sites.google.com/site/macsarmatools/squint/shell-integration).

Muzzleflash
Aug 23 2010, 19:54
Please catch Enter keypress so you can use autocomplete so stuff like:
AUTOCOMPLETE = AUTOCOMPLETE AUTOCOMPLETE (AUTOCOMPLETE AUTOCOMPLETE AUTOCOMPLETE);

Is more worth than it is trouble.

sbsmac
Aug 23 2010, 20:03
Sorry, you're going to have to explain that one a bit more clearly. Here's how it works on my machine....

* I type d..i..s and the autocomplete box is showing me a bunch of options.
* I use the down arrow to scroll to the one I want, "disableUserInput"
* I press ENTER and the autocomplete box disappears and "dis" is replaced by "disableUserInput" in the codewindow.

The only thing I can think of you might be doing differently is to be using the mouse or scroll-wheel to select the desired word before pressing enter? In that case the enter is ineffective (since focus has moved away to the autocompletion control). Maybe this is what you would liked fixed ?

Muzzleflash
Aug 23 2010, 20:06
I get another effect as well:

* I type d..i..s and the autocomplete box is showing me a bunch of options.
* I use the down arrow to scroll to the one I want, "disableUserInput"
* I press ENTER and the autocomplete box disappears and "dis" is replaced by "disableUserInput" in the codewindow.
* A newline is created immediately after the autocompletion
Maybe you only been testin' on fresh files? In that case you created a bunch of newlines at the end then?

HeliJunkie
Aug 23 2010, 20:07
Want only to say: Looks really great!
Didn't have the time to test it full, but really a nice work!
Will use it in the next time, and I think it will save me a lot of time!
THANKS for this editor!

Tankbuster
Aug 23 2010, 20:15
Ruddy brilliant!

sbsmac
Aug 23 2010, 20:28
Glad you like it guys :)

1.0.0.87 - hopefully this fixes what you were talking about MuzzleFlash ? For bonus points you can now double-click in the autocomplete box to select.

*Bug #13220: mousewheel not working in code-window (http://dev-heaven.net/issues/13220)
*Bug #13221: autocomplete now works with double-click in list or enter after mouswheel/click (http://dev-heaven.net/issues/13221)
*Bug #13222: autocomplete inserted extra newline (http://dev-heaven.net/issues/13222)


Maybe you only been testin' on fresh files? In that case you created a bunch of newlines at the end then?

<cough> I only write this stuff- please don't ask me to test it as well ;)

Muzzleflash
Aug 23 2010, 20:31
*Bug #13222: autocomplete inserted extra newline (http://dev-heaven.net/issues/13222)
Yay that fixed it :yay:


<cough> I only write this stuff- please don't ask me to test it as well ;)
Sure as long as we can bitch about our strange finds :)

sbsmac
Aug 23 2010, 20:49
Hmm, I think JamesF1 referred to it as 'constructive criticism' !

Talking of which I managed to miss this post earlier...


If you ever feel like 'outsourcing' a few parts to others (such as those not so tied up in the lexer, or such), I'm sure there are a number of people around who have experience with .NET (myself included) who could contribute in some way... even if it's just research-related. Personally, I couldn't promise much time, but well, the offer's there.

That's a very interesting offer and one that I may well take up in future. Right now I'm at that stage in a project's life where it's a tangled mess of 'temporary' hacks that only makes sense in my head - very soon I will have to take a step back and knock it back into something that looks more like real software. If you're a net programmer though there are the beginnings of some documentation here (https://sites.google.com/site/macsarmatools/docs). Clearly that's only a very small subset of what goes into squint but it might be interesting to some people.

What I'd really like to outsource is some of the documentation/promotion. The two presentations I did were quite fun and a good break from coding for a couple of hours but I'm painfully conscious of how 'bare' the documentation is. How many people apart from muzzleflash even know that there is an autocomplete feature? And the lack of bug-reports/questions about preprocessed mode implies that a lot of people aren't aware of how useful this can be. Etc etc. Any serious offers to help out here would be most appreciated, even if it's just another couple of paragraphs I can paste into the webpage... :)

Muzzleflash
Aug 23 2010, 21:06
sbsmac this isn't priority bug however it is annoying enough you may want to put it pretty high on the list :). (Sorry still no dev-heaven user):

When writing a "non-closed" string and multiple lines follow (in my problem case about 200) then squint becomes very sluggish until the string is closed. You can avoid part of this sluggishness by writing the close string immediately, however even the closing character takes 5s before analysing (I think) is done. Hurts computer when writing format strings.

If this lag is due to analysing then perhaps limiting string parsing to the line being written or something.

sbsmac
Aug 23 2010, 21:18
Thanks will take a look at why this is so slow. Off the top of my head I suspect that squint is matching your opening quote against the first following one it finds in the file (strings in sqf can span multiple lines annoyingly). Obviously having done an unbalanced match it will start treating the contents of that string as commands and so on. The end result is that it is probably generating hundreds of errrors and copying these into the error window is what I think is really slowing things down (all other analysis and rendering is done by a bacground thread so shouldn't impact editing) .Limiting the error count to a sensible number is probably the best fix for this.

JamesF1
Aug 23 2010, 21:40
That's a very interesting offer and one that I may well take up in future. Right now I'm at that stage in a project's life where it's a tangled mess of 'temporary' hacks that only makes sense in my head - very soon I will have to take a step back and knock it back into something that looks more like real software.
You should see most of the code I've deployed to clients :p I don't actually have many pieces of code that I've ever sat back and gone: "I'm 100% happy with that." Part of being an overly-self-critical, I guess :rolleyes:


If you're a net programmer though there are the beginnings of some documentation here (https://sites.google.com/site/macsarmatools/docs). Clearly that's only a very small subset of what goes into squint but it might be interesting to some people.
Will have a look through when I get some time. I've done a decent amount of serious development in C#, but I'm far from a .NET expert... I'm one of those guys who can write genuinely useful applications in a variety of languages (from x86 ASM, through to Prolog, and back again)... but I simply don't get enough day-to-day 'practice' in any one language to achieve 'mastery'. Jack of all trades, master of none ;)


How many people apart from muzzleflash even know that there is an autocomplete feature?
I'd say that one would be fairly obvious as soon as you start typing :p

Ragnar_Darude
Aug 23 2010, 22:19
A while back ago a made a program (in Net 3.5) that could send code/script back and forth from ArmA 1. It also monitored the Arma.rpt file in real-time for any errors that the script generated so you could easily identify what went wrong. What it also did was monitored variables and when they changed you could be notified aswell as get a history of previous values the variable held. I dont think it would be a huge ordeal to port the program to Arma 2. I suggest you check it out as the functionality of this program would complement yours (merge maybe?).

LINK (http://forums.bistudio.com/showthread.php?p=1475378)

Regards
Ragnar_Darude

sbsmac
Aug 23 2010, 22:23
Ah, but autocomplete is off-by-default because it was an experimental feature so unless you've specifically turned it on you won't see it. :)

Just for a bit of light relief from the coding I felt compelled to start a blog about squint development. I know 99% of them are read by less than 1.5 people but what the hell, it gives me an outlet for some of the frustrations....

Crosseyed and Painless (http://squintymusings.blogspot.com/)

I'll even take requests if people are interested in particular aspects of the tool ;)

callihn
Aug 23 2010, 22:28
What is "Enable keyword protection"?


BTW, it turnded out on my script examples the other two were OK, it just didn't like the _moved set to anything > 0, seems that makes things constantly respawn, which is wierd considering they really have not moved.

Thanks

sbsmac
Aug 23 2010, 23:06
What is "Enable keyword protection"?

A misquote of "enable keyword prediction" :)

If you turn it on, squint will pop up a little dialog box as you start to type things that look like keywords.

For example if you turn it on (make sure the menu item is checked) and type 'p', you'll see a box appear under your typing showing all the keywords starting with 'p' type 'l' next and the list is narrowed to all those that start with 'pl'. Use the up and down arrows if you want to go and manually select one of the ones you see. Press ENTER to copy the selected keyword into the code window. Use TAB to do unix-style word completion.

So for example the sequence d..i..s..a..TAB..DOWN_ARROW..ENTER gets you "disableConversation".

It also knows about local variables. Soon enough I'll teach it about global variables and function names.

---------- Post added at 12:06 AM ---------- Previous post was Yesterday at 11:42 PM ----------


sbsmac this isn't priority bug however it is annoying enough you may want to put it pretty high on the list . (Sorry still no dev-heaven user):

When writing a "non-closed" string and multiple lines follow (in my problem case about 200) then squint becomes very sluggish until the string is closed. You can avoid part of this sluggishness by writing the close string immediately, however even the closing character takes 5s before analysing (I think) is done. Hurts computer when writing format strings.

If this lag is due to analysing then perhaps limiting string parsing to the line being written or something.


I've limited the number of error reports shown to 10 as a workaround for now until I come up with a better solution.

Muzzleflash
Aug 23 2010, 23:13
Interesting read on your blog.

I really feel more confident in my scripting in squint. When smart(er) indenting is implemented I will never use anything else for arma editing.

Will you add hotkeys for fixing bugs, duplicating a line and other stuff?

sbsmac
Aug 23 2010, 23:21
TY :) CTRL-ALT-F to fix a bug (see https://sites.google.com/site/macsarmatools/squint/command-reference, 'keyboard shortcuts' column) for other useful keys.

Duplicate a line... I always just tend to use Home,shift-down-arrow, shift-delete,shift-insert,shift-insert which sounds a lot worse than it is to actually do ! Happy to add shortcuts for these kinds of things though if you have specific suggestions.

And the indenting is something I'm quite keen on myself having become addicted to auto-indent in emacs and ctrl-e-d in Visual Studio. There is already an auto-indent feature for cpp files but its a bit harder to make it work for sqf...

Muzzleflash
Aug 23 2010, 23:27
The only suggestion I can think of at the moment is the duplicating line. CTRL+D? Of course this is just a personal preference.

First: I haven't giving it much thought. However, isn't the only thing determining basic indentation in sqf braces? You start at "indentation level" 0. When opening brace is encountered you go to level 1 on all following lines. And so on. When closing brace is found you go one level down on all next lines or something like that?

callihn
Aug 23 2010, 23:31
Ohh, thanks Mac, doesn't look like a good day to script when I can't read any better than that, LOL!

BTW, I tried the reformat, I don't think it should be deleting things?

sbsmac
Aug 24 2010, 01:23
However, isn't the only thing determining basic indentation in sqf braces? You start at "indentation level" 0. When opening brace is encountered you go to level 1 on all following lines. And so on. When closing brace is found you go one level down on all next lines or something like that?


BTW, I tried the reformat, I don't think it should be deleting things?

Thanks - I was wondering what to write next! Indentation - lex or parse ? (http://squintymusings.blogspot.com/2010/08/indentation-lex-or-parse.html)

Callihn (and others) the main point of that post is you should NOT try to use the CPP indenter/formatter on sqf files at the moment (really I should disable this in the menu),

callihn
Aug 24 2010, 03:12
Thanks - I was wondering what to write next! Indentation - lex or parse ? (http://squintymusings.blogspot.com/2010/08/indentation-lex-or-parse.html)

Callihn (and others) the main point of that post is you should NOT try to use the CPP indenter/formatter on sqf files at the moment (really I should disable this in the menu),

OIC, BTW can you make it do some kind of animation or something to let us know it's still working, that way we know when it's ready for more input.

Muzzleflash
Aug 24 2010, 11:59
Thanks - I was wondering what to write next! Indentation - lex or parse ? (http://squintymusings.blogspot.com/2010/08/indentation-lex-or-parse.html)
No problem, it was an interesting read and I learnt new stuff. Just don't forget to write stuff in .Net too :).

Oh and stop calling me MuzzleFlash dammit :D!!!!!!

sbsmac
Aug 24 2010, 12:25
My apologies Mr Flash, it has now been corrected ;-)

gunterlund21
Aug 24 2010, 13:52
squint when I open a PBO and save, is it saving as a pbo or where does it go. Great tool.

sbsmac
Aug 24 2010, 15:30
When you open a pbo, you'll notice that sqint shows you all the files inside that pbo and you can edit these as text. (This even works for binarised 'rap' files.).

If you modify an sqf file (for example) from the pbo and then save it, the sqf file will be written back into the pbo and then the pbo will be written back to disk - in other words you can edit files inside a pbo 'in place' without ever having to worry about manually extracting or repacking the pbo yourself.

There are a couple of areas where this needs a little tweaking...

1) If you use 'save as' to save a file from a pbo under a different name, you get the standard file dialog which makes it look like you are saving to disk. In fact you end up saving to pbo with a path that looks like a fully-qualified disk-path. Not good !

2) You can't yet save unbinarised rap files back to rap again after modifying them. I actually have this working on my debug build but there are a couple of corner cases where you could lose data so it's currently disabled for release builds.

When I rework the file-list I'll probably make it a lot easier to transfer files between domains - ie it will be possible to take all the files inside a pbo and drop them to disk as text files etc. Hope that explains it - feel free to follow up if you still have questions.

The main point though is that if you just stick to 'Save' or 'Save all' everything will work correctly and you can save yourself a lot of time by not having to muck around with pbo-extractors :)

---------- Post added at 04:30 PM ---------- Previous post was at 03:13 PM ----------

1.0.0.89 is now out...

*Bug #13197: Add option to disable line numbers (http://dev-heaven.net/issues/13197)
*Bug #13233: Add tabs-to-spaces conversion under Tools menu (http://dev-heaven.net/issues/13233)
*Bug #13234: Move auto-complete enable/disable to new settings/editor dialog (http://dev-heaven.net/issues/13234)
*Bug #13235: Implement basic auto-indent (http://dev-heaven.net/issues/13235)
*Task #13230: disallow format in sqf files (http://dev-heaven.net/issues/13230)

You can read about the auto-indent on this page (https://sites.google.com/site/macsarmatools/squint/tips-tricks). It's not terribly sophisticated but works well enough for basic editing and is pretty similar to how emacs works. It has a few little quirks - to TAB-indent a closing brace you need to put the cursor on the line below and you can probably find other cases where it is less-than-perfect (comments on the same line after an opening brace for example).

(And no, before you ask, I haven't yet made the insert-private-array work with it...)

Muzzleflash
Aug 24 2010, 15:35
Awesome, just made a script in 10 minutes to remove dead bodies in 100 lines. It worked right out of squint no bug to solve. Normally there would be a pair of minor syntax errors at least. No bugs:


/*
Script to remove dead bodies.
Muzzleflash

!!! Should not be used with units in which you want to keep the group !!!

** Initialize **

[TYPE, PARAMS] "run" BR_Initialize.sqf;
Probably best run separate!
Type can be:
"INTERVAL" - Bodies will be removed at PARAMS seconds intervals
"DELAYED" - Bodies will be removed a PARAMS seconds after death

** Exposed functions **
grp call BR_AddGroup
obj call BR_AddObject
arr call BR_AddArray
*/

#define __Push(arr,var) arr set [count arr, var];

//Only server. "killed" event handler local etc..
if (!isServer) exitWith {};

BR_Type = toUpper (_this select 0); //Type of body remover
BR_Params = _this select 1; //Parameters

if (BR_Type == "DELAYED") then {
BR_Delay = BR_Params;
};
if (BR_Type == "INTERVAL") then {
BR_Interval = BR_Params;
};

//The actual list of items to be removed
BR_ToBeRemoved = [];

/********"Exposed" functions ********/
BR_AddObject = {
_this call BR_AddDeadEvent;
};

BR_AddGroup = {
{_x call BR_AddObject} forEach (units _this);
};

BR_AddArray = {
{_x call BR_AddObject} forEach _this;
};
/*************************************/

//Add killed event
BR_AddDeadEvent = {
_this addEventHandler ["killed", {(_this select 0) call BR_AddToBeRemoved}];
};

//Adds object to be removed
BR_AddToBeRemoved = {
private ["_val"];
if (BR_Type == "INTERVAL") then {
__Push(BR_ToBeRemoved, _this)
};
if (BR_Type == "DELAYED") then {
_val = [_this, time+BR_Delay];
__Push(BR_ToBeRemoved, _val)
};
};

//Removes body
BR_RemoveBody = {
private ["_body","_grp"];
_body = _this;
_grp = group _this;
//Delete body
if (isNull _body || alive _body) exitWith {};
deleteVehicle _body;
sleep 0.13;
if (count units _grp <= 0) then {
deleteGroup _grp;
};
};

BR_IntervalRemover = {
while {sleep BR_Interval; true} do {
//Remove body
{_x call BR_RemoveBody} forEach BR_ToBeRemoved;
sleep 0.43;
//Remove null references
BR_ToBeRemoved = BR_ToBeRemoved - [objNull];
};
};

BR_DelayedRemover = {
private ["_idx","_obj"];
while {sleep 5.3; true} do {
//Count number of indices to remove
_idx = 0;
while {time >= ((BR_ToBeRemoved select _idx) select 1)} do {
_idx = _idx + 1;
sleep 0.06;
};
//Remove those indices
for "_i" from 0 to (_idx -1) do {
_obj = (BR_ToBeRemoved select _i) select 0;
_obj call BR_RemoveBody;
BR_ToBeRemoved set [_i, objNull]; //Flag it as null
sleep 0.12;
};
sleep 0.28;
//Remove those bad references
BR_ToBeRemoved = BR_ToBeRemoved - [objNull];
};
};

//Spawn the handler
if (BR_Type == "INTERVAL") then {
[] spawn BR_IntervalRemover;
};
if (BR_Type == "DELAYED") then {
[] spawn BR_DelayedRemover;
};

BR_HasInitialized = true;

squint complained when I put the right hand side of _val into the macro:


_val = [_this, time+BR_Delay];
__Push(BR_ToBeRemoved, _val)

Where __Push is:


#define __Push(arr,var) arr set [count arr, var];

Is it that really true. Can the preprocessor not comprehend this? squint said something like wrong number of arguments. Haven't worked with C for years and that was very basic, I did not do much work with the preprocess there.

sbsmac
Aug 24 2010, 16:05
I think you mean squint complained when you wrote


__Push(BR_ToBeRemoved,_[_this, time+BR_Delay])

IIRC the C proprocessor has no problem with this but the OFP/A2 preprocessor is a bit simpler and doesn't 'see' the square brackets inside the macro argument list. So it tries to execute the following (colours used to indicate separate arguments)


__Push( BR_ToBeRemoved , [_this , time+BR_Delay] )



Ie, it sees 3 arguments rather than 2 ! This has actually caught me out a couple of times in the past. :(


Squint (naturally) does its best to emulate the quirks of the Arma preprocessor rather than implementing a C preprocessor. There are a few more 'interesting' characteristics - for example try


#define A(FOO) FOO BAR
#define B(BAR) A(BAR)

B(argument)

then look at the preprocessed output if you want a surprise. Believe it or not this really is the way the ArmA PP works !

Sickboy was very helpful in pointing out all the ways in which early versions failed to produce 'matching' output when thrown at ACE (which makes very extensive use of macros so I'm very confident that I have a near-exact emulation.

The one area where squint is actually stricter that it needs to be is that it is possible in Arma to write


#define A(X,Y) something
A(1)


and get away with it. Since I can't see that this would ever be done except by mistake, squint flags this as an error - "incorrect number of arguments".

Muzzleflash
Aug 24 2010, 16:16
Ahh thought it might be something to do with the comma. Thanks for explaining.

Just noticed copying from squint into keynote kept the syntax highlighting, a thing some other editors do not. Very nice :bounce3:


_mag = sqrt (random 1.00) * _a;
Careful - this may not evaluate as you expect - use brackets

My english terminology is far from perfect, but isn't it parantheses?

sbsmac
Aug 24 2010, 16:32
Yep . technically 'parentheses' is more specific than 'brackets'. But 'brackets' tends to be used colloquially - one very rarely hears 'parentheses' in normal speech, even amongst programmers :)

British usage tends to be (IME) ...
() - "brackets"
{} - "braces" or "curly brackets"
[] - "square brackets"
<> - "angle brackets"

Wikipedia claims that in the US things are a bit more as you say...

BTW - don't know if you noticed the last update post since it came out as you were posting but I added auto-indent for you ;-)

Muzzleflash
Aug 24 2010, 16:47
I did notice an update when I started squint again to check something, however was already finished with script. Just fired up squint and wrote an if statement:
OMG OMG OMG OMG :yay: :bounce3: awesome. "Sorry SQF plugin for N++. It's just that I've met someone else. Someone who really get's me." :D.

I only program as a hobby at the moment, though I will soon be studying software engineering, so don't really know what stuff it is called amongst programmers yet. Now I know what part of this stuff is called :).

---------- Post added at 18:47 ---------- Previous post was at 18:40 ----------

I can see on dev-heaven that you are working on tabs-to-spaces and that the options is already in. Tab is currently broken however,, functions more like home at the moment, and pressing tab on a completely empty file gives an IndexOutOfRangeException.

sbsmac
Aug 24 2010, 16:59
Tabs-to-spaces is already in and should be working. Not tested but it's only a one-line function so what could possible go wrong (famous last words) ?.....

Tab is behaving as expected (apart from the exception you see). See this bit of the manual (https://sites.google.com/site/macsarmatools/squint/tips-tricks#TOC-Auto-indent) to understand the way it works. :)

Muzzleflash
Aug 24 2010, 18:32
You're right it was me being stupid. I was trying to indent a line improperly and squint of course corrected me. I then started thinking it was the program's fault, like any user would do ;)

Muzzleflash
Aug 24 2010, 23:32
Minor bug?


//ACRE checker
if (isClass (configFile >> "cfgWeapons" >> "ACRE_PRC148")) then {
G_ACRE = true;
} else {
G_ACRE = false;
};

When auto-indented:



//ACRE checker
if (isClass (configFile >> "cfgWeapons" >> "ACRE_PRC148")) then {
G_ACRE = true;
} else {
G_ACRE = false;
};

sbsmac
Aug 24 2010, 23:46
I hate to say it but that's about as good as the indent is likely to get for a while. Getting it to indent in the style you want would required the indenter to rewind through the tokens on the previous line and realise there was a closing brace at the start of the line. Actually I'll look at adding this special case but you're starting to see the limits of lexical indentation ;-)

In the meantime, 1.0.0.90 is released

*Bug #13238: Pressing TAB in an empty file gave an exception (http://dev-heaven.net/issues/13238)
*Bug #13247: Add BIS and ACE functions to dictionary (http://dev-heaven.net/issues/13247)

The main feature here is that I have addded BIS and ACE functions to the dictionary of global variables. This has a couple of benefits...
1) You should no longer get 'unknown variable' errors when calling these functions.
2) The auto-complete will offer them as candidates and potentially save you a lot of typing.

Muzzleflash
Aug 24 2010, 23:54
I totally understand I just wanted to let you know the issue if you didn't already.

How do you plan on going around handling unrecognised global variables? Perhaps a box where you can write whitespace-separated globals?
Or an option to ignore warning?

sbsmac
Aug 25 2010, 00:33
At this stage I think the only unrecognised globals you should see would be from addons that declare additional function libraries. There are a few approaches to this...

1) Teach squint how to read CfgFunctions sections in addons (actually quite straightforward)
2) Allow the import of textual lists of functions which the user (or addon maker) can create.
3) Have a project/global dictionary to which the user can add exceptions when they run across unknown variables.

Muzzleflash
Aug 25 2010, 00:41
There are a few times where you might have a valid reason to create a variable the dynamic way using call compile format for example, so I don't think number 1 is going to do it alone.
Nevermind, but don't think number 1 is going to solve it alone.

sbsmac
Aug 25 2010, 11:06
A couple of minor tweaks to auto-complete...

1.0.0.91..

* Feature #13251: Add common control constructs to auto-complete (http://dev-heaven.net/issues/13251)
*Feature #13250: Improve auto-indent so that it only offers function names after call or spawn (http://dev-heaven.net/issues/13250)

What the first one means is you can type

f..o..r..DOWN..DOWN..ENTER to get the template


for [{},{},{}] do {};

for example.

NoBrainer
Aug 25 2010, 16:28
Thank you sir!

:notworthy:

sbsmac
Aug 25 2010, 19:01
No problem :)

1.0.0.92 adds search-and-replace and makes detection of errors in multi-file projects a priority.

*Bug #13254: line-numbers incorrect when switching between multiple files in project (http://dev-heaven.net/issues/13254)
*Bug #13263: Increase priority of error-detection over rendering (http://dev-heaven.net/issues/13263)
*Feature #13262: Add search and replace (http://dev-heaven.net/issues/13262)

cobra4v320
Aug 25 2010, 20:13
Squint freezes on me and I end up having to ctrl alt delete to get out of it, does anyone else have these issues. It doesnt happen every time I get into it either.

sbsmac
Aug 25 2010, 20:21
Actually I think I may have seen the same although I had put it down to developing on a very flaky laptop.

In my case I think this occurs when squint is just left unattended with no input for some period of time (which is odd because it's not actually running very much code at that point!) but I haven't really nailed it down. If you have a reliable 'recipe' for reproducing this it would be very helpful to hear it.

*Edit* It seems that squint on my laptop is very susceptible to problems with power-management. If I close the laptop lid and reopen it, squint is guaranteed to hang, even if doesn't even have any files or projects open. I'll see if I can reproduce this in the debugger.

*Edit again* Nope-it works fine under the debugger. Power-management on my laptop is really extremely bad (screen keeps repainting itself for about a minute after opening the lid) but other apps seem to cope ok.

Cobra - it would be very useful to know if you are using a laptop or PC, whether you have configured iit to drop down into low-power modes, and whether you think this might be at all related to the hangs that you see (I may be chasing a red-herring here).

cobra4v320
Aug 25 2010, 20:54
Tested: If I leave squint idle after a certain amount of time it will stop working.

sbsmac
Aug 25 2010, 21:05
Seems we simul-posted :) Could you take a look at my edited previous post and comment on whether you think power-management might be a factor ?
Thx.

Also, just to be clear, could you confirm the symptoms of the 'hang' that you see? In my case the squint window just goes completely dead and won't repaint itself after another window has been dragged in front although sometimes I do get the actualy title-bar coming back. This argues quite strongly for some mechanism where the windows message-pump has gone awol...

cobra4v320
Aug 25 2010, 21:15
Im using a PC/vista and my power management is set to the highest setting.

It just freezes on screen and I have no way to close the window, currently I dropped it down and now I cannot bring it back up or shut it down.

Also if I minimize the window then it is guaranteed to freeze if I leave it for more than a minute or so.

sbsmac
Aug 26 2010, 07:17
Hmm - haven't yet managed to reproduce it by leaving the window minimized but I may be missing a step ...

Do you still get the problem if you don't load any files or type anything in the **Scatch** window ? Do there need to be errors showing in the error-list for this to occur ?

Thx-any ideas you have to narrow this down would be most helpful. In the meantime I'll take a look at why it's crashing under power-management. Hopefully it's the same cause.

cobra4v320
Aug 26 2010, 07:55
I will try and troubleshoot, but another issue is that Ctrl - Z or undo at the top does not work for me either.

sbsmac
Aug 26 2010, 09:05
Thanks - I've just fixed the ctrl-z issue in 1.0.0.93 (forgot to wire up the menu action because I'm so used to using ALT-BKSPC :) )

sbsmac
Aug 26 2010, 14:39
Good news first - I know what is causing the hang -more annoying MS UI threading limitations.

Bad news - my cunning plan to use a RichTextBox in a background thread to do highlighting now looks like it will not work and I'm contemplating having to write a simple RTF encoder.

More later....

Muzzleflash
Aug 26 2010, 21:19
Not sure if I am the only one experiencing this. However, I found editing config files in pbo very buggy. Sometimes when deleting some text it seems to be gone. The line numbers decrease. Then 2s later when scrolling the text is back.

Sometimes (often) when writing/editing more about 2 lines it seems to hiddenly revert back to the text before.

sbsmac
Aug 26 2010, 21:38
Strange - I just tried this with a randomly selected pbo (l39.pbo) and it all seemed fine. Is the config file you are editing particularly large? I'm just finishing off the fix for the hang that Cobra reported which should in any case make the rendering a bit smoother and will see again if I can reproduce the problems you're seeing tomorrow. In the meantime, any extra information you can figure out would be helpful.

Muzzleflash
Aug 26 2010, 21:59
Well first I wanted to delete 3000 lines because I was making some "on-top" changes (instead of writing from an empty file, I just wanted to remove irrelevant stuff from the config I was adding some changes to) to some configs. The lines just reappeared. I finally got a small 60 line config going, however as I was typing random text that I wrote got corrupted. I was writing "class" and it turned out to be "cladd". No i'm pretty sure I didn't hit the wrong key cause It was "ss" on the screen for a short while before being replaced. Sometimes part of the next line would be deleted and strange things.

While this is user error, you may want to catch the exception that occurs when you try to save the pbo you have opened in squint when arma is using it.

sbsmac
Aug 27 2010, 16:23
I suspect everyone is too busy with BAF to care too much about this but....

1.0.0.94

*Bug #13297: Squint could hang when idle (http://dev-heaven.net/issues/13297)
*Bug #13299: Allow background colour and font of file-list and error window to be customised (http://dev-heaven.net/issues/13299)
*Feature #13205: Customisation of appearance (http://dev-heaven.net/issues/13205)

New dialog... http://www.armaleague.com/mac/misc/appearance.PNG

You can also now change the font and background colour of the error-list and file-list

ruebe
Aug 27 2010, 16:44
that's great!
Thanks.

(and now back to BAF, :shoot::cancan: thiiihihihi)

CarlGustaffa
Aug 27 2010, 17:26
Oh, nice. I can answer because I don't have BAF :D

sbsmac
Aug 27 2010, 21:49
I've just added Import and Export buttons to the colour/font selection dialog. This will allow you to export your colour settings to an ".sxml" file.

If you come up with any colour schemes you are particularly proud of, please export them and post them here (the files are just small text files) and I will then start a library of 'themes' on the squint webpage.

Evil_Echo
Aug 27 2010, 23:33
Despite 1.54 and BAF, still paying a lot of attention to Squint and loving it. Some good stuff coming out soon - made even better thanks to this tool.

sbsmac
Aug 28 2010, 08:46
Thx - look forward to seeing it :)

<cough> Still hoping for some nice colour-schemes from people who thought they could do better than my black background :p

---------- Post added at 09:46 AM ---------- Previous post was at 08:26 AM ----------

I thought it was worth summarising the changes since squint's 'official' release last week.. Here's a copy of the project update (https://sites.google.com/site/macsarmatools/project-updates) on the squint page. Thanks again to all those who have offered feedback and suggested changes (and especlially to those whose quotes I have misappropriated!)



Squint went public just over a week ago and the feedback has been extremely pleasing...


"Flippin awesome tool. fixed a bunch of errors right on loading."

"Awesome tool thanks for sharing, already found some errors in a couple of scripts that I didnt even notice."

"Squint is a major help in finding errors - it found quite a few I must say I was shocked it was able to find (nice tracing through files)"

"This is amazing stuff! The best scripthelper created over the last 10 years. Love it!"

"Sorry SQF plugin for N++. It's just that I've met someone else. Someone who really get's me."


But no release is perfect and there have been a lot of great suggestions on how to improve squint. Based on those I've been working hard to add the following features....

* Support for the following file-extenstions: *.ext;*.sqm;*.cpp;*.hpp;*.rvmat;*.bin;*.cfg;*.pbl
* Line-numbers have been added to the code-window.
* Search and replace have been added
* An 'undo' feature has been implemented
* A basic auto-indent has been implemented; you can auto-indent code as you go along or select a region and hit TAB to auto-indent.
* Auto-complete/intellisense has been implemented. When enabled, squint will monitor your typing and offer you a choice of possible completions in a pop-up dialog box. This really saves a lot of time and effort for those long BIS_fnc_.. names! Auto-complete can also offer you completion for local variable names that are in scope and can help you avoid 'bracket-fatigue' by offering completions for common control constructs, eg "for [{},{},{}] do {};" as a completion of "for".
* The colour scheme is more flexible than before. You can change the background colour and font used by the file-list and error-list and you get an immediate preview of your colour-changes for the code-window.
* You can import and export colour 'themes'; I hope to host some user-made themes on the squint website over the next week - please contact me via the BIS forums if you have a colour-scheme you'd like to share.
* BIS & ACE function names have been added to the dictionary as 'known' global variables.
* An external helper app allows shell-integration. Just right click on a file to open it in squint !
* Support for binarised files is now implemented. You can edit the contents of config.bin or any other binarised file, even those already inside pbo's.
* The error-detection phase is now much faster for large multi-file projects.
* The code-window now has much less flicker when jumping around within a file.
* As well as the new features, a significant number of bugs have been fixed including one that could cause squint to hang while idle.


Thanks to all who have provided feedback so far - please keep it coming to help me improve the tool.

To learn more about the new features, see these two links

* Shell integration (https://sites.google.com/site/macsarmatools/squint/shell-integration)
* Tips & Tricks (https://sites.google.com/site/macsarmatools/squint/tips-tricks)


As always, existing users should find that they are automatically updated to the latest version which is currently 1.0.0.95. If squint is not updating, you can force an update by re-running the setup file.

Muzzleflash
Aug 28 2010, 11:14
"Support for binarised files now implemented" - Very nice. Great work :D.

sbsmac
Aug 28 2010, 11:29
"Support for binarised files now implemented" - Very nice. Great work .

Actually a quick clarification on that... atm it's only for viewing. If you try to save a modified binarised file you'll get a dialog saying you can't. I'm very close to getting this working but it'll take a few days and there don't seem to be a lot of people jumping up and down for this so other things will likely take priority.

Katrician
Aug 28 2010, 11:42
Looks really great but I must be dumb... I have installed Squint, and when I want to open a .sqm or .sqf file I have only "Open Project" button, and the file to be open "must" be .sqt?? How do I open a file whatever its name, and not a project??

sbsmac
Aug 28 2010, 11:48
The thing to realise is that you are always working within the scope of a project, even if it's just the default 'new project'. So to open sqf/ext/pbo etc files, just use the "File->Add To Project" menu or, much easier, just drag them across from the desktop into the file-list.

The last slide of the presentation on this page (https://sites.google.com/site/macsarmatools/squint/getting-started)
shows this.

*Edit* More info here (https://sites.google.com/site/macsarmatools/squint/working-with-projects)

ruebe
Aug 28 2010, 12:55
<cough> Still hoping for some nice colour-schemes from people who thought they could do better than my black background :p

Somehow I feel slightly addressed by this, :D

Ok, here are two of them:

a warmish one: <Codeview>
<FontName>
Consolas
</FontName>
<FontSize>
11
</FontSize>
<Background>
Snow
</Background>
<Highlight>
AliceBlue
</Highlight>
<Default>
Black;Regular
</Default>
<Comment>
LightSlateGray;Regular
</Comment>
<LocalVar>
OrangeRed;Regular
</LocalVar>
<GlobalVar>
Firebrick;Regular
</GlobalVar>
<Operator>
Black;Regular
</Operator>
<String>
Navy;Regular
</String>
<DeffedOut>
LightSkyBlue;Strikeout
</DeffedOut>
<Macro>
LightSeaGreen;Regular
</Macro>
<Other>
White
</Other>
<OtherFontName>
Consolas
</OtherFontName>
<OtherFontSize>
9.25
</OtherFontSize>
</Codeview>

and a frosty one: <Codeview>
<FontName>
Consolas
</FontName>
<FontSize>
11
</FontSize>
<Background>
Snow
</Background>
<Highlight>
AliceBlue
</Highlight>
<Default>
Black;Regular
</Default>
<Comment>
LightSlateGray;Regular
</Comment>
<LocalVar>
DarkMagenta;Regular
</LocalVar>
<GlobalVar>
Navy;Regular
</GlobalVar>
<Operator>
Black;Regular
</Operator>
<String>
DarkCyan;Regular
</String>
<DeffedOut>
DarkSlateGray;Strikeout
</DeffedOut>
<Macro>
DarkSlateGray;Regular
</Macro>
<Other>
White
</Other>
<OtherFontName>
Consolas
</OtherFontName>
<OtherFontSize>
9.25
</OtherFontSize>
</Codeview>



Though I'm not really happy with them either (I'm using the latter).

For one, I'm absolutely no fan of your color-dropdown-boxes with color-names. Haven't you access to a regular color-picker? Using a list of name-colors is probably never a good idea (it wasn't even a good idea for things like "websafe colors" back in the other century)..
I mean, I have a name for the main colors, but that's were it ends. What is Salamon? A color? Really? Firebrick? What? CadetBlue or DodgerBlue? What's the difference? My argument is: I don't know these color-names and never will, thus this dropdown-list is barely useable. I know blue and red and yellow and green, but that's it. :D
The problem is also the order of the colors. Ordering them alphabetically by color-names is a bad idea. The natural (and thus useable) order of colors is the rainbow/color spectrum. Doesn't .net come with it's default color-picker?

Second, I don't think it's a good idea to show the font's in the font dropdown-menu. It makes it slow and hard to use. This is no photoshop, so I think we don't need a preview of fonts to choose one. (also I got an error browsing through my fonts, probably because some font was in an unuseable format.. so thats another reason to not do this and show the available fonts in a regular font)

Third, I'm not sure why, but somehow I feel it's all too colorful. Maybe that's the result of my code beeing written in an easy script language. Or maybe it's simply still a bit unfamiliar (in comparison to other editors/languages I use). But what strikes me most is that I really need to set the operators color to regular black, for if I don't, nothing is in regular text color anymore, which renders this exercise a bit useless (if everything is in color/important, then nothing is).
I think you need to further divide the "operators":

core syntax, control structures and the like (if, then, switch, etc.. but also all brackets/paranthesis); syntax
core/predefined commands; functions/commands
atomic values such as boolean or player (ok, you may argue this is a command, and probably you'd win the argument, hehe), which are currently also colored in the operators color; atomic


^^ Splitting this up a bit would for sure help to prevent everything from becoming a fancy color.
And also numbers should have their own color (like in most editors out there)

But otherwise I'm happy with the new options we've got.
Thanks and keep it up! ;)

sbsmac
Aug 28 2010, 14:23
I have no idea why you would think I was referring to you Mr. Black :whistle:

Thank you though - very much appreciated and I have to admit I do rather like 'frosty'


Though I'm not really happy with them either (I'm using the latter).

Well, I've made them available here (https://sites.google.com/site/macsarmatools/squint/colour-schemes) for those who want to try them - hope you don't mind my post-modernist art critique blurbs ;)



For one, I'm absolutely no fan of your color-dropdown-boxes with color-names. Haven't you access to a regular color-picker? Using a list of name-colors is probably never a good idea

Ah I see, you were just softening me up with the gift of the colour-schemes before moving in for the kill :p Let me explain the thinking and I'd be interested in other people's thoughts...

First, there is no 'standard' colour chooser in .Net apart from a full-on dialog which I thought was complete overkill (and I hated having to click 'change', pick the colour, click 'OK' again etc). So the drop-down style seems like a better option. But then you have to decide what to put in the drop-down list.. colour names, the colours themselves, or some combination? I agree the colour names aren't meaningful on their own. So I started by using the colours (like the original dialog). Then I decided it would be more meaningful to display some text in the desired colour on the chosen background colour so as to best indicate what the end-result would look like. The text is arbitrary but might as well be the colour-name rather than "sample text".

The ordering is as-they-are-sorted in the windows Color enum. I agree that 'rainbow' ordering would be better if someone can point me to a good (and simple to implement) RGB ordering algorithm.



I don't think it's a good idea to show the font's in the font dropdown-menu. It makes it slow and hard to use

The slowness is probably because there is some very inefficient redrawing of that dialog whenever anything changes (won't bore you with the details). Personally I like having the fonts displayed because I hate the traditional font-pickers where you have to keep clicking on a font to find out what it's going to look like.


also I got an error browsing through my fonts, probably because some font was in an unuseable format

If you can reproduce this, can you post the exception details here ?


Third, I'm not sure why, but somehow I feel it's all too colorful. Maybe that's the result of my code beeing written in an easy script language. Or maybe it's simply still a bit unfamiliar (in comparison to other editors/languages I use). But what strikes me most is that I really need to set the operators color to regular black, for if I don't, nothing is in regular text color anymore, which renders this exercise a bit useless (if everything is in color/important, then nothing is).

Yes actually I agree very much with this. It's probably because I have the colour-sense of a 5-year-old and the graphic-design skills of a chimp which is why, all joking aside, I'm very grateful to people who are willing to put together colour-schemes that look a bit more 'professional'. (My very first colour-scheme which I might yet publish as 'fisher-price' used comic-sans in large font and very bright colours and reminded me of something my children used to play with...)

http://www.otherlandtoys.co.uk/product_thumb.php?img=images//magneticboard2.jpg&w=228&h=200&ow=350&oh=200



* core syntax, control structures and the like (if, then, switch, etc.. but also all brackets/paranthesis); syntax
* core/predefined commands; functions/commands
* atomic values such as boolean or player (ok, you may argue this is a command, and probably you'd win the argument, hehe), which are currently also colored in the operators color; atomic


Some of these would be easier than others; detecting whether an operator is 'atomic' (ie has no operands) is quite straightforard for the renderer. OTOH, brackets are just thrown into the general 'separator' category along with semi-colons and anything else and are currently rendered in the 'Default colour.


But otherwise I'm happy with the new options we've got.
Thanks and keep it up!

Thanks and even if I don't always agree, it's useful to have the feedback :)

---------- Post added at 03:23 PM ---------- Previous post was at 03:03 PM ----------




I've just had someone else report the font-choosing exception. Can anyone provide more details since I can't reproduce this here ?

http://dev-heaven.net/issues/13322

ruebe
Aug 28 2010, 14:57
...hope you don't mind my post-modernist art critique blurbs
Haha, certainly not. :D


Ah I see, you were just softening me up with the gift of the colour-schemes before moving in for the kill
:D:D:D

But really, you need a color picker and the default os color picker dialogue (http://www.lkwdpl.org/classes/MSPaint/menus/colorpicker.png) would be totally fine. You want good color schemes? Give us a color picker. For instance I'd like to have the same color for global and private variables, but with different saturation for example to get only a subtile difference... With your color-names list I'm totally screwed.


...and I hated having to click 'change', pick the colour, click 'OK' again etc
I'm sorry, but you won't play around with that dialogue anymore once it's setup. So this really does not need to be fast/quick workflow wise.. and even if, I'd argue that a color picker is still faster, because it's reliable. A color picker is easy to use and very precise, your colornames-list is absolutely not.


Personally I like having the fonts displayed because I hate the traditional font-pickers where you have to keep clicking on a font to find out what it's going to look like.

Uhm, even in photoshop(!) the font-selector drop-down is all rendered in a default font - for good reasons. If you don't know your fonts, I suggest you use a font-browser software or something. Squint should not do this too. It's not a font-browser and tools should not try to do too many things, but a few things really good. At least that's the software philosophy I agree with.


If you can reproduce this, can you post the exception details here ?

Posted them in your bug tracker. And yes, it's quite easy to reproduce, though I really can't tell what font causes the problem. All I have to do is scrolling through the font-list and at some point a font probably can't get rendered and then ... see, that's a problem font-browser software needs to deal with. You definitely shouldn't worry about that for squint.


Can anyone provide more details since I can't reproduce this here ?

http://dev-heaven.net/issues/13322

Done.

sbsmac
Aug 28 2010, 15:06
Thanks for the exception details. Actually the issue was that one of the fonts in the list did not support 'Regular' style so whilst I could have deferred the exception for a bit by not rendering it in the selection box, it would still have caused a an exception if selected.

Anyway (hopefully) fixed now and I'll look at the colour stuff later.

ruebe
Aug 28 2010, 15:12
Anyway (hopefully) fixed now...
Ha, that was fast and indeed it is fixed now. At least I can't bring up that exception again. Though it's still a bit slow due to the rendering of all these fonts, but I can live with this now, I guess. :D

Katrician
Aug 28 2010, 15:56
The thing to realise is that you are always working within the scope of a project, even if it's just the default 'new project'. So to open sqf/ext/pbo etc files, just use the "File->Add To Project" menu or, much easier, just drag them across from the desktop into the file-list.

The last slide of the presentation on this page (https://sites.google.com/site/macsarmatools/squint/getting-started)
shows this.

*Edit* More info here (https://sites.google.com/site/macsarmatools/squint/working-with-projects)

Hello Sbsmac I found out finally how to open "as a project", but not working on projects, I've been left in the dark as to how to open a file on the fly; as would say Captain Obvious users of Windows are "trained" to find open,close file(s) buttons and not system project; it was new to me as a genuine no coder entity :D, thus why not adding a menu to quick open any file you check, because I tend to use files (opening for reference,checks,editing) from different missions, there's always a sqf you need when making a mission, and often they would be located in different folders from different missions. Why not adding my remarks in the FAQ?

Then questions come to mind as this one, tried Squint with BIS official missions and Squint found errors, even if the mission works fine, so my question is does Squint overkill in terms of errors?

sbsmac
Aug 28 2010, 17:04
Right then ruebe, the colour-choosers in the editor settings page now have a little button labelled '...' which can be used to bring up the standard colour dialog so I expect to see some 'perfect' colour schemes from you now :p


Why not adding my remarks in the FAQ?

Good suggestion - will do. *Edit* Added here (https://sites.google.com/site/macsarmatools/squint/faq#TOC-Help---I-just-want-to-check-a-file-)


Then questions come to mind as this one, tried Squint with BIS official missions and Squint found errors, even if the mission works fine, so my question is does Squint overkill in terms of errors?

Interesting point. Detecting errors in software is a 'hard problem'. As I'm sure you are aware, a mission that runs perfectly under some circumstances will sometimes have errors if you play it differently. Squint takes the approach of warning you about 'unsafe' code but just because it flags a warning doesn't mean that the code or mission is guaranteed to fail.

It's a bit like me coming to your house and pointing out that you storing petrol in empty milk bottles in the cupboard-under-the-stairs is not 'safe'. You might respond that you always keep the cupboard door locked, don't ever allow anyone who smokes into the building, and know what you are doing (and in any case, it's none of my damn business!) but when your house burns down the insurance company will probably say you were pretty daft to ignore my warnings ! :)

For example, a lot of the BIS mission scripts have code that looks a bit like this..


player sidechat format ["blha blha %1",_sentenceId] ;

where _sentenceId is a variable that is not defined in the script but which is assumed to exist by the author of the mission. It's very likely that BIS have written their missions in such a way that _sentenceId always will exist but squint flags a warning anyway. Why ? Well, one day, someone might forget that they need to define _sentenceId before calling the script. Thus squint is often warning you of potential errors rather than actual ones.

(Personally I think that the way the BIS missions call scripts is not terribly good coding and they should pass more stuff in as parameters but since we're not writing code for the space-shuttle here perhaps I'm overly picky!)

Note the difference between errors and warnings - denoted by 'E' and 'W' in the error-list. Errors are almost always definite syntax errors which you do need to fix whereas warnings are just indications of potentially unsafe code. (Interestingly, there are several real errors which I've found in the BIS missions using squint - just need to get around to reporting these.)

So coming back to your original question...


is squint overkill in terms of errors?

No. You can certain choose to ignore the warnings and often (as with my example about the petrol in your house) you can get away with it for a long time. However a warning is at least something you should look at and ask yourself whether you really intended to write the code that way. :)

Katrician
Aug 28 2010, 17:40
Right then ruebe, the colour-choosers in the editor settings page now have a little button labelled '...' which can be used to bring up the standard colour dialog so I expect to see some 'perfect' colour schemes from you now :p



Good suggestion - will do.



Interesting point. Detecting errors in software is a 'hard problem'. As I'm sure you are aware, a mission that runs perfectly under some circumstances will sometimes have errors if you play it differently. Squint takes the approach of warning you about 'unsafe' code but just because it flags a warning doesn't mean that the code or mission is guaranteed to fail.

It's a bit like me coming to your house and pointing out that you storing petrol in empty milk bottles in the cupboard-under-the-stairs is not 'safe'. You might respond that you always keep the cupboard door locked, don't ever allow anyone who smokes into the building, and know what you are doing (and in any case, it's none of my damn business!) but when your house burns down the insurance company will probably say you were pretty daft to ignore my warnings ! :)

For example, a lot of the BIS mission scripts have code that looks a bit like this..



where _sentenceId is a variable that is not defined in the script but which is assumed to exist by the author of the mission. It's very likely that BIS have written their missions in such a way that _sentenceId always will exist but squint flags a warning anyway. Why ? Well, one day, someone might forget that they need to define _sentenceId before calling the script. Thus squint is often warning you of potential errors rather than actual ones.

(Personally I think that the way the BIS missions call scripts is not terribly good coding and they should pass more stuff in as parameters but since we're not writing code for the space-shuttle here perhaps I'm overly picky!)

Note the difference between errors and warnings - denoted by 'E' and 'W' in the error-list. Errors are almost always definite syntax errors whereas warnings are just indications of potentially unsafe code.

So coming back to your original question...



No. You can certain choose to ignore the warnings and often (as with my example about the petrol in your house) you can get away with it for a long time. However a warning is at least something you should look at and ask yourself whether you really intended to write the code that way. :)

Your prog is amazing really, and you are not over picky I like fine tuning too like I do on my motorcyle, back on Squint I have simplified a sqf and it works great, even if I don't grab the code lingo, I'm really interested into it. EG :

Before :


_sideHQ = createCenter EAST;
_grp = createGroup EAST;
_tmp = [markerPos "posGlbSpawn2", 180, "LandRover_SPG9_TK_EP1", _grp] call BIS_fnc_spawnVehicle;
//[_grp] call BIS_fnc_spawnCrew;
_wp = _grp addWaypoint [markerPos "wpBrdm", 0];
_wp setWaypointType "GUARD";
//_wp setWaypointBehaviour "COMBAT";
//_wp setWaypointCombatMode "RED";


After Squint tuning :



private ["_grp","_wp"];
_grp = createGroup EAST;
[markerPos "posGlbSpawn2", 180, "LandRover_SPG9_TK_EP1", _grp] call BIS_fnc_spawnVehicle;
_wp = _grp addWaypoint [markerPos "wpBrdm", 0];
_wp setWaypointType "GUARD";




You raise a valid point with sentenceId I got this error while checking BIS official mission, so when Squint highlight this type of error, what would be the solution to fix it? If I understand correctly Squint analyses all the files and find code not-related in any of the files.

For the average mission maker we have no clear structure to build missions and spend big time trying, checking forums etc... it's complicated by the fact that each files communicate with each others but we don't have a visual scheme or mental image...

Thanks for your work :thumb:

ruebe
Aug 28 2010, 18:44
Right then ruebe, the colour-choosers in the editor settings page now have a little button labelled '...' which can be used to bring up the standard colour dialog ...

Yeah, that's nice. Though IMHO you could remove the namelist/dropdown-box now alltogether and just display a rectangle with the currently choosen color. Nice and simple. But as you like. :)

Second, and this is more important, once you startup the color picker, the currently selected/defined color needs to be repicked, which currently doesn't happen.. so it's currently a bit of a hassle to find the "sweet spot" of a color, since you can't slightly adjust the last picked one... should be no big deal to pass the initial color to the picker I guess :)



... so I expect to see some 'perfect' colour schemes from you now :p

Ahahaha, I should have known that I'm driving myself into trouble again with my big and dirty mouth, hahaha... :D

Ok, here's another one. In honour of the flaming one, I call this composition "the frozen jerk":



<Codeview>
<FontName>
Consolas
</FontName>
<FontSize>
11
</FontSize>
<Background>
Snow
</Background>
<Highlight>
AliceBlue
</Highlight>
<Default>
Black;Regular
</Default>
<Comment>
ff918d4f;Regular
</Comment>
<LocalVar>
ff0261ae;Regular
</LocalVar>
<GlobalVar>
ff02266a;Regular
</GlobalVar>
<Operator>
Black;Regular
</Operator>
<String>
ff525252;Regular
</String>
<DeffedOut>
ffa6a6a6;Strikeout
</DeffedOut>
<Macro>
ff8d8d8d;Regular
</Macro>
<Other>
White
</Other>
<OtherFontName>
Consolas
</OtherFontName>
<OtherFontSize>
9.25
</OtherFontSize>
</Codeview>




It's a classy one.
Enjoy :D


oh, and here is the "real" flaming jerk, hehe:



<Codeview>
<FontName>
Consolas
</FontName>
<FontSize>
11
</FontSize>
<Background>
Snow
</Background>
<Highlight>
AliceBlue
</Highlight>
<Default>
Black;Regular
</Default>
<Comment>
ff918d4f;Regular
</Comment>
<LocalVar>
ffe62e00;Regular
</LocalVar>
<GlobalVar>
ff840003;Regular
</GlobalVar>
<Operator>
Black;Regular
</Operator>
<String>
ff525252;Regular
</String>
<DeffedOut>
ffa6a6a6;Strikeout
</DeffedOut>
<Macro>
ff8d8d8d;Regular
</Macro>
<Other>
White
</Other>
<OtherFontName>
Consolas
</OtherFontName>
<OtherFontSize>
9.25
</OtherFontSize>
</Codeview>




and a final one for now.. "We're in the money" hahaha:



<Codeview>
<FontName>
Consolas
</FontName>
<FontSize>
11
</FontSize>
<Background>
fffffffd
</Background>
<Highlight>
ffffff80
</Highlight>
<Default>
Black;Regular
</Default>
<Comment>
ffc1ab53;Regular
</Comment>
<LocalVar>
ff737807;Regular
</LocalVar>
<GlobalVar>
ff0e7610;Regular
</GlobalVar>
<Operator>
Black;Regular
</Operator>
<String>
ff60613a;Regular
</String>
<DeffedOut>
ffa6a6a6;Strikeout
</DeffedOut>
<Macro>
ff8d8d8d;Regular
</Macro>
<Other>
White
</Other>
<OtherFontName>
Consolas
</OtherFontName>
<OtherFontSize>
9.25
</OtherFontSize>
</Codeview>




---

oh, there's one more thing: I've tried to do one with a dark background color. The problem is that the operator-color doesn't affect syntax (parenthesis, semicolons and stuff) and numbers... so these characters stay black, which obviously doesn't work with a dark background.

But I guess you've decoupled these already from the "Operators"-color, but haven't put the new catogeries into the code-window panel from the Colours and font selection yet... right?

sbsmac
Aug 28 2010, 20:10
Second, and this is more important, once you startup the color picker, the currently selected/defined color needs to be repicked, which currently doesn't happen.. so it's currently a bit of a hassle to find the "sweet spot" of a color, since you can't slightly adjust the last picked one... should be no big deal to pass the initial color to the picker I guess

Good point and now done.
Also added some of the new scripting commands in the latest release.

Thanks for the extra compositions - I can see you have a thing about pink which I shall comment on no further ! They'll be on the website shortly :)


The problem is that the operator-color doesn't affect syntax (parenthesis, semicolons and stuff) and numbers... so these characters stay black, which obviously doesn't work with a dark background.

Actually these are under the 'default' colour. The problem is that I forgot to wire that one up (I knew I was bound to miss one) when I changed the rtf-rendering mechanism -now fixed so you should be able to change this.

@<hidden>

Glad you like it :)


You raise a valid point with sentenceId I got this error while checking BIS official mission, so when Squint highlight this type of error, what would be the solution to fix it? If I understand correctly Squint analyses all the files and find code not-related in any of the files.

Well obviously with the BIS missions you might as well leave them alone since they are working 'well enough'. (In the future I will implement a mechanism to allow you to disable some of squints error checks so you can ignore the ones you are confident are 'safe'.)

If you were writing your own script that was generating an error similar to the "_sentenceID" one you talk about, I would suggest that you just change the way you call the scripts. Eg, instead of writing


//sidechat.sqf - a script to talk to the player
player sidechat format ["hello %1",_aVariable] ;


and then using

_aVariable="World";
execVM("sidechat.sqf");

I would suggest you write sidechat.sqf as function...


doSidechat={
player sidechat format["hello %1",_this select 0];
};

then call it with the string you want...


call compile preprocessfile "sidechat.sqf"; //compile all the functions inside the library file (you only need to do this once in init.sqf

["world"] call doSidechat;

sbsmac
Aug 29 2010, 12:32
1.0.0.100 now out...

*Bug #13011: check for strings in case statements and 'in' (http://dev-heaven.net/issues/13011)
*Bug #13337: Test for mismatch of types in switch statements (http://dev-heaven.net/issues/13337)
*Bug #13351: Errors were not correctly sorted (http://dev-heaven.net/issues/13351)
*Bug #13354: types of undeclared variables were not always propagated correctly (http://dev-heaven.net/issues/13354)
*Feature #13338: Numbers can now be coloured differently from brackets (http://dev-heaven.net/issues/13338)

Last one is just for ruebe ;)

ruebe
Aug 30 2010, 02:47
I can see you have a thing about pink which I shall comment on no further
bwahahaha,
now I see it too :icon_ohmygod:

In my defense: on my primary monitor, the color does not look pink at all, just not that brighty whitey. But yeah, on the other one, I can clearly see what I did there.. :D



Last one is just for ruebe ;)
Ahhhh, that's great.
I like my colors red. :rolleyes2:


Btw. it would be nice, if we could drag'n'drop our files anywhere, especially to the main editors window too and not only to the overview window. I catch myself a few times trying to drop a file in the editor's window, simply because that was the only area I could access that moment (overview was behind some other application, squint beeing out of focus)..


Oh and.. I just got aware of a little coloring problem:

(checkAIFeature "AwareFormationSoft")
Here, "AwareFormationSoft" get's rendered in the "Default" color instead of the defined "String" color. I'm not quite sure why this happens. Funnily here:

"AwareFormationSoft" enableAIFeature true;
"AwareFormationSoft" gets colored correctly in the defined string color.

Maybe some function signature mixup or mistyped argument?

hmmm, also here:


onTeamSwitch {
private ["_leader"];
//...
};
the "_leader" inside private does not get colored in the string color, but in the operators color instead. Funnily here:


onTeamSwitch {
private ["_leader", "_b"];
_b = ["correctlyColoredAsString", "yeahMeToo"];
//...
};
"_leader" and "_b" are still in the wrong color, but "correctlyColoredAsString", "yeahMeToo" are fine.



And while we're at it, here my latest color-scheme, featuring colored numbers but otherwise pretty minimal and inspired from my notepad2 color-scheme I like to use; uhm, let's call it "Chez Luigis":


<Codeview>
<FontName>
Consolas
</FontName>
<FontSize>
11
</FontSize>
<Background>
White
</Background>
<Highlight>
AliceBlue
</Highlight>
<Default>
ff0a246a;Regular
</Default>
<Comment>
Green;Regular
</Comment>
<LocalVar>
Black;Regular
</LocalVar>
<GlobalVar>
Black;Regular
</GlobalVar>
<Operator>
Black;Regular
</Operator>
<String>
Green;Regular
</String>
<DeffedOut>
Orange;Strikeout
</DeffedOut>
<Macro>
Orange;Regular
</Macro>
<Number>
Red;Regular
</Number>
<Other>
White
</Other>
<OtherFontName>
Consolas
</OtherFontName>
<OtherFontSize>
9.25
</OtherFontSize>
</Codeview>


Do you see how much fun numbers in color, especially in red, are?
:292:

sbsmac
Aug 30 2010, 07:04
Btw. it would be nice, if we could drag'n'drop our files anywhere, especially to the main editors window too and not only to the overview window. I catch myself a few times trying to drop a file in the editor's window, simply because that was the only area I could access that moment (overview was behind some other application, squint beeing out of focus)..

Fair point - will add this. Actually kju already raised it as http://dev-heaven.net/issues/12861


Oh and.. I just got aware of a little coloring problem:

Hmm - couldn't reproduce your first string-colouring problem -seems to work fine for me. As you surmised in http://dev-heaven.net/issues/13367 though, it looks like squint is missing a couple of operator definitions (every time Ithink I have got them all BIS seem to add another couple!) so I'll add these.

Squint is smart enough to know that quoted strings inside private arrays (and isnil and for) are local variable names so you are seeing them being coloured in the 'local variable' colour.


And while we're at it, here my latest color-scheme

Lol - I can see I've created a monster. The red is ok but Orange for preprocessor directives ? :p

Here's my favourite scheme.... FisherPrice (http://www.armaleague.com/mac/squint/themes/FisherPrice.sxml) ;)

callihn
Aug 30 2010, 09:59
Hey Mac can we get bracket pair matching and you might consider adding a default button on the code-window settings, I still think it would be nice to know when it is still working too, when loading large projects it becomes a guessing as to when it is finished checking all the files.

sbsmac
Aug 30 2010, 10:09
Hey Mac can we get bracket pair matching and you might consider adding a default button on the code-window settings, I still think it would be nice to know when it is still working too, when loading large projects it becomes a guessing as to when it is finished checking all the files.

You can get bracket-matching by right-clicking anywhere in the code-window and selecting 'highlight bracketed area' - squint will 'search' out to the first set of enclosing brackets - '{' '(' or '['. Is this what you were after ?


you might consider adding a default button on the code-window settings

Yes, good suggestion but in the meantime there is a 'default' scheme available from the colour schemes (https://sites.google.com/site/macsarmatools/squint/colour-schemes) page.



I still think it would be nice to know when it is still working too, when loading large projects it becomes a guessing as to when it is finished checking all the files.

Good idea. It won't actually do any harm if you want to start editing a file before squint is finished analysing the project but I'll think about some way to get it to indicate it is busy.

ruebe
Aug 30 2010, 11:24
Squint is smart enough to know that quoted strings inside private arrays (and isnil and for) are local variable names so you are seeing them being coloured in the 'local variable' colour.
hmm, while I understand that kind of reasoning, I still do not agree with this.. for technically these are not local variables, but only the declaration of local variables and as such these are strings.
But don't worry, I guess that's your design choice. :)


Lol - I can see I've created a monster.
...says the guy coding with fisher price colors on black background...
:pet12:


The red is ok but Orange for preprocessor directives ? :p
Yeah, that's right!
Friggin orange! :yay:

Maybe I should do one along these lines (http://www.mrtoys.com/images/Fisher-Price-Computer-Cool-School.jpg). That should suit you better, I guess.
Do you see that orange buttons? Beautiful, aren't they? :D

sbsmac
Aug 30 2010, 12:39
Maybe I should do one along these lines. That should suit you better, I guess.
Do you see that orange buttons? Beautiful, aren't they?

Lol - I have to get one of those ! Wonder if it'll run Arma...

callihn
Aug 31 2010, 15:29
Now Squint is only showing partial files stopping at 147 lines.

Also for a few updates now just opening a file makes it appear changed and prompts you to save on exit even when no changes were actually made.

sbsmac
Aug 31 2010, 16:04
>Now Squint is only showing partial files stopping at 147 lines.

You'll need to help me out a bit more on that one since "it's working for me" ;)

>Also for a few updates now just opening a file makes it appear changed and prompts you to save on exit even when no changes were actually made.

Will double-check this.

TRexian
Aug 31 2010, 16:12
Mac-

Just got around to working with this, installing NET4 was the hangup. :) I'm seriously impressed - this is a huge asset!

I'll also apologize for not reading the entire thread before posting my only critique. :D I re-use alot of code and just rem out the old stuff until I'm finished. Bad part is, I'm almost never "finished" so they just sit there, but either get caught in the private statement, or show up as an undeclared variable.

Is there some way to have a tier system where bad stuff - like an undeclared variable - shows the file as red, but less important stuff - like an unused declared variable - only shows the file as yellow or something? Or the ability to mark certain errors as "ignore"?

Thanks for a great tool!

T

sbsmac
Aug 31 2010, 16:54
Glad you like it. Funnily enough I'm just putting the finishing touches to a 'filter' system which allows you to mask out certain errors. It seems to work quite well - using it I can actually load the thousand-odd files from missions.pbo and reduce the amount of 'fluff' to the point where I can start to see genuine errors.

I'll be pushing out a new version that includes this ability shortly - just got to write a little documentation for it first :)

TRexian
Aug 31 2010, 17:01
2 things:

First - that is FANTASTIC response time!!! :D

Second - WTF? A coder who documents? What sort of alien intelligence are you!?!?!?111eleventyone

sbsmac
Aug 31 2010, 17:27
Ha-ha - check out the subpages on the squint page. I've had very little feedback on the documentation (positive or negative) so kind of wondering whether it's really worth doing but hopefully some people read it.

TRexian
Aug 31 2010, 17:36
I'm a bit of a documentation hound, so I've already taken a look. No complaints really. Might be nice to have screenshots of the themes instead of the text. My imagination is good, but not THAT good. :)

I'm also digging a bunch of your other tools (no, not THAT one, although you are a handsome man). You now be bookmarked by me.

Oh... and... uh....


Working with pbos and binarised rap files
Squint can work directly on the files inside a pbo. It can also 'unrap' binarised files automatically, even those inside a pbo. When you modify a file inside a pbo and then save it, the file is written back into the pbo and the pbo itself is written back to disk.


That... uh.... IS KINDA A FREAKING BIG DEAL! Can't wait to try that.

Just an idea for a feature, but I'm not sure how realistic it is. I'm getting to a point where I have a core set of stuff, then stuff that branches off from it, but some of these are related. Like my mines - there are a couple other versions I'm doing specifically for mods with special requirements. Would possibly be helpful to have subprojects of projects that I can borrow across, then do subproject-specific name/variable changes.

Does that even make any sense?

callihn
Aug 31 2010, 18:43
>Now Squint is only showing partial files stopping at 147 lines.

You'll need to help me out a bit more on that one since "it's working for me" ;)

>Also for a few updates now just opening a file makes it appear changed and prompts you to save on exit even when no changes were actually made.

Will double-check this.


I found what broke it and I'll show you via PM.

sbsmac
Aug 31 2010, 19:37
Excellent - thanks :) Got your PM and I'll try and figure out why it's misbehaving.

---------- Post added at 08:37 PM ---------- Previous post was at 08:07 PM ----------

k - fix coming up shortly.

@<hidden> - lol, finally my very own internet stalker ;)

>That... uh.... IS KINDA A FREAKING BIG DEAL! Can't wait to try that.


Ty - I think it's pretty neat as well although no-one else has commented on it. One slight restriction - for now you can't actually change binarised files. I just need to make a couple more tweaks to allow that.


Just an idea for a feature, but I'm not sure how realistic it is. I'm getting to a point where I have a core set of stuff, then stuff that branches off from it, but some of these are related. Like my mines - there are a couple other versions I'm doing specifically for mods with special requirements. Would possibly be helpful to have subprojects of projects that I can borrow across, then do subproject-specific name/variable changes.

I'm not entirely sure what you are getting at here (sounds like a good revision control system that handles branching would be useful to you). In terms of squint, there is nothing to stop you having one 'uber' project that consists of all your files and then a different project that just contains a subset. Does that help ?

TRexian
Aug 31 2010, 20:02
That does help. I need to become more familiar with your app before I really start offering any critique. (Probably should've done that before posting, too.) ;) The functionality I'm looking for may very well already be in there.

It would also help if I were actually organized....

Katrician
Aug 31 2010, 20:06
Don't let Sbsmac take a breath claim for new features 24/24 :D

By the way Sbsmac I'd like to edit scripts while in Squint, sadly there is no copy/paste feature like Notepad; I know Squint is primary for checking errors, but its colors are great for lines full of soldiers, ie "TK_Soldier_EP1" when you have twelve or more Notepad is confusing.


Secundo is Squint needing large ressources? because it takes some times to open then check a project.

Third not related to Squint, but related to "coding", too more often the mission I load in the editor get an error TK_Soldier no more here, in fact it adds a space eg " TK_Soldier...." instead of "Tk_Soldier...", I fix the error opening the mission SQM with Notepad, suppress the empty space, save, reload the mission in the editor, save it, and usually an similary errors or the same reappears?? any ideas to fix it for once and all?

sbsmac
Aug 31 2010, 20:59
Don't let Sbsmac take a breath claim for new features 24/24



hehe- I like to be kept busy !


By the way Sbsmac I'd like to edit scripts while in Squint, sadly there is no copy/paste feature like Notepad;

Oh yes there is ! Have you tried CTRL-C or CTRL-V ? ;) I'm trying to make squint an editor just as much an error-checker so feedback here is very useful.


Secundo is Squint needing large ressources? because it takes some times to open then check a project.



It depends on the size of the project. I just fixed a bug which caused squint to be much slower opening large files than it needed to be. The fix for this will be in version 101. There is a certain amount of work squint needs to do when opening a project.. it needs to open all files, parse them, collate all the global variables, then check for errors before pre-rendering all the files in those pretty colours. I'm still tweaking this aspect so expect some more improvements here. I'm currently working with a project that has over one thousand files (missions.pbo from OA) and squint can handle that although it takes a couple of minutes to check everything.


Third not related to Squint, but related to "coding", too more often the mission I load in the editor get an error TK_Soldier no more here, in fact it adds a space eg " TK_Soldier...." instead of "Tk_Soldier...", I fix the error opening the mission SQM with Notepad, suppress the empty space, save, reload the mission in the editor, save it, and usually an similary errors or the same reappears?? any ideas to fix it for once and all?


I'm not sure I understand your explanation of what is happening - could you go through it again a bit differently ? The only thing I can guess at is that it might be something to do with line-endings but that's a bit of a long-shot.

---------- Post added at 09:35 PM ---------- Previous post was at 09:21 PM ----------

1.0.0.101 is out...
*Bug #13227: unclosed strings don't get correctly highlighted in string colour (http://dev-heaven.net/issues/13227)
*Bug #13367: missing signature for some commands (waypointAttachObject, enableAIFeature) (http://dev-heaven.net/issues/13367)
*Bug #13373: line-numbers coud lose sync when deleting text from the end of a file (http://dev-heaven.net/issues/13373)
*Bug #13387: It was possible for characters to get lost whilst typing quickly in large files (http://dev-heaven.net/issues/13387)
*Bug #13399: Squint now much faster (preprocessing phase used very inefficient string building) (http://dev-heaven.net/issues/13399)
*Bug #13402: precedence still needs a little tweaking (http://dev-heaven.net/issues/13402)
*Feature #13374: Add link to colour-schemes page from settings (http://dev-heaven.net/issues/13374)

Squint also contains a protoype filter system which I will document on the website shortly....

---------- Post added at 09:59 PM ---------- Previous post was at 09:35 PM ----------

Documentation on filters: https://sites.google.com/site/macsarmatools/squint/filters-and-the-dictionary

NOTE- this is an experimental feature I'm still playing with so will probably change. Feedback welcome from those who want to give it a try.

TRexian
Aug 31 2010, 21:59
Did some quick fiddling.

Very much like the filter arrangement. Encompasses everything I can think of for now.

In the documentation...



Embedded filters are more useful if you play to re-use files...


I think you meant "plan"? :)

Otherwise, well done, and so far, so good....

Edit:
It appears that if I want to make the '_smthng' declared but not used globally filtered, it doesn't use wildcard?

sbsmac
Aug 31 2010, 22:23
Ta - typo fixed.


It appears that if I want to make the '_smthng' declared but not used globally filtered, it doesn't use wildcard?

Right-click on the error and choose "filter out for all files in project".
Then go to the filters menu and choose "edit project filters"
Look for
//#squint filter '_smthng' declared but not used
at the end of the file and replace '_smthing' with '*'

If you have already done all that and not seeing the errors disappear in other files it's because I haven't yet wired things up so all the error-lists get rechecked after you've added a global filter (it's still a wip feature!). You can force this though by right-clicking in the file-list and choosing "Reload all files in project" (careful, this will discard any edits you haven't yet saved.)

Other 'gotchas' - adding filters doesn't mark the project as 'changed' so you can easily fall into the trap I keep making of spending 10 minutes setting up all my filters then losing them by loading a new project before saving the old one. Just hit 'save all' on a regular basis and you shouldn't go too far wrong.

ruebe
Aug 31 2010, 23:18
I'm trying to make squint an editor just as much an error-checker so feedback here is very useful.

In that case, I have one for you: text selection. Do something about it. At least on my xp box, selecting text in squint is a pain in the ass(!), because it snaps the selection to some obscure pattern.
:16_6_8:

Let's have an example:



private ["_tmp"];

If I try to select "_tmp", I fail everytime. Starting the selection at the first quote, I can select up to "_. The moment I try to select "_t it snaps the selection to ["_tmp (I don't want to select the friggin brackets!). And if I try to select from right to left, starting with the closing quote, the moment I select p" it snaps to tmp"];?! WTF?!

Due to this selection-auto-snap, I'm much too annoyed to use squint for any means of coding/editing - it is such a hassle.

So if you could look into this selection-snap behaviour and shut it the *peep* off, that would be really bananas.
:), ehhrm here, this one: :yay:

Snake Man
Sep 1 2010, 02:13
I'm seriously impressed - this is a huge asset!
I told you so...

TRexian
Sep 1 2010, 02:16
Neener neener neener..... :D

Was kinda hoping you didn't check back on this thread.... ;)

sbsmac
Sep 1 2010, 17:13
102 now out - fixes the broken preprocessor view and has much more efficient update of project status when applying filters.
Should also load large projects faster because files are no longer pre-rendered.
Finally, projects are marked as 'dirty' when filters are changed.


In that case, I have one for you: text selection. Do something about it.

Unfortunately yet another brokeness to do with MS and their bl^%dy richtextbox. Apparently there are workarounds which I'm looking at.

i0n0s
Sep 2 2010, 00:30
With the latest version I get a few errors, so I better drop them here, so that they won't get lost.

-Long files won't get scanned completely. I have multiple files where he stopped scanning somewhere in the document and doesn't report any more errors in it, even if the are present.

-Example code for the lbSize bug:
http://pastebin.jonasscholz.de/993

-Nearly similar for ?ctrlSetText?, maybe the str:
http://pastebin.jonasscholz.de/994

-in a catch-block, _exception is a defined variable:
http://community.bistudio.com/wiki/try

-Use a different fond in warning details to better differ _i from _j

sbsmac
Sep 2 2010, 06:43
Thanks. The limited number of errors is

http://dev-heaven.net/issues/13226

Squint actually scans the whole file, it's just that because the datagridview is so slow, the number copied to the list in limited to 10. Still looking for a good workaround for this.

I've added the lbsize bug at http://dev-heaven.net/issues/13448

Will look at adding the _exception variable

>-Use a different fond in warning details to better differ _i from _j


If you look under settings/editor/other windows, you can change the font (and background colour) used in the warning window and filelist :)

TRexian
Sep 2 2010, 12:18
Here's something in the nature of mistake-it-didn't-find. :)

I'm doing a config, that has me copying and pasting from several different sources. I ended up duplicating about 3 entries. Is there some way to have it parse each config class and check if there's already been an entry for something?

No big deal - ArmA was happy enough to point it out to me upon starting. ;) 3 times.

sbsmac
Sep 2 2010, 12:34
This is exactly the kind of thing I was hoping people would suggest - I've reached the limits of my imagination for error-checks so ideas from other people are most welcome. Also I don't work a lot with configs so currently squint is particularly light on cpp checking.

>Is there some way to have it parse each config class and check if there's already been an entry for something?

It's already parsing the whole file so yes, it's fairly straightforward to add rules based on structure. Can you post a short example code-fragment showing the error and a brief explanation of where and why it's an error. I'll then look at adding a rule.

TRexian
Sep 2 2010, 12:45
I've reached the limits of my imagination for error-checks...

Dude. My errors are some of the most imaginative around! :D


Can you post a short example code-fragment showing the error and a brief explanation of where and why it's an error. I'll then look at adding a rule.

Soitenly:



class cfgAmmo
{
class BulletBase;
class JTD_coolNewUberAmmo: BulletBase
{
simulation = "";
hit = 1;
indirectHit = 1;
indirectHitRange = 1;
typicalSpeed = 100;
model = "";
cartridge = "";
simulation = "shotShell";
hit = 3;
indirectHit = 2;

};
};


See how the last 3 are the same as the first 3? Those duplicate entries will prevent ArmA from starting. In terms of de/concatenation, I think if you take everything in front of the '=' and see if it matches any other entry up to the '=' that would work.

(I'm big on ideas, much shorter in terms of coding.)

sbsmac
Sep 2 2010, 19:50
Dude. My errors are some of the most imaginative around!
(I'm big on ideas, much shorter in terms of coding.)

Excellent, I can see we were made for each other :p I'll take a look at adding this rule shortly.

In the meantime there is another release... 1.0.0.103. It fixes a couple of minor precedence issues and significantly increases the speed of the UI.

On my feeble old laptop (2.2Ghz core duo) I can now load and analyse the 1014 files from Operation ArrowHead's missions.pbo in under 30 seconds - not too shabby and I haven't even optimised the preprocessor or parsers yet.

You should also notice the editing experience is a bit smoother - auto-complete was horribly inefficient and has been reworked to be bit less cpu hungry.

Finally, I managed to introduce some flicker into the code-window in the last release- that should be gone now.

i0n0s
Sep 2 2010, 22:10
If you like to have some inspiration for features:
What about scanning for duplicated code?

Would be a really nice feature on larger codes to reduce the complexity.

sbsmac
Sep 3 2010, 06:50
Interesting idea. What 'scale' do you think is appropriate - codeblock, function, file ? Probably the most sensible way would be to produce a hash of the expression tree (ignoring specific variable names) Will think on this...

i0n0s
Sep 3 2010, 08:15
I think codeblock would be nice.

Katrician
Sep 3 2010, 21:30
Editing the .ext file with Squint, it wanted to remove equal sign(s) where there was no text after the equal sign e.g
Text = ;, I did and got the .ext file bugging OA at the start related to the removed equal signs.:cool:

Squint is faster great improvement.:yay:


In a previous post of mine, you told me about not understandig my question, so I will try again to expalin. When saving a file, then reopening it after the code or txt loose its "order" e.g :

1 txt
// it makes coffee
2 txt
3 txt

File is saved and when I reopen it I got this (happens usually with large files):

1 txt // it makes coffee 2 txt 3 txt

As you see the // remove 2 txt and 3 txt, because at first it was not on a single line. Hope it's clear :rolleyes:

ChiefRedCloud
Sep 3 2010, 23:47
When I run setup I keep getting "Not a valid win32 application. I've downloaded the .net you showed and tried three different links. From reading the posts I seem to be the only one who can't run it. Any ideas?

zwobot
Sep 4 2010, 07:39
Can't install it either. Tried to download the setup with different browsers and PCs to no avail.

Install.log


The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.1.0 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package 'Microsoft .NET Framework 4 Client Profile (x86 and x64)', phase BuildList
Reading value 'Version' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Client'
Read string value '4.0.30319'
Setting value '4.0.30319 {string}' for property 'DotNet40Client_TargetVersion'
The following properties have been set for package 'Microsoft .NET Framework 4 Client Profile (x86 and x64)':
Property: [DotNet40Client_TargetVersion] = 4.0.30319 {string}
Running checks for command 'DotNetFX40Client\dotNetFx40_Client_x86_x64.exe'
Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true
Result of checks for command 'DotNetFX40Client\dotNetFx40_Client_x86_x64.exe' is 'Bypass'
Running checks for command 'DotNetFX40Client\dotNetFx40_Client_setup.exe'
Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'DotNet40Client_TargetVersion' and value '4.0.30129': true
Result of checks for command 'DotNetFX40Client\dotNetFx40_Client_setup.exe' is 'Bypass'
'Microsoft .NET Framework 4 Client Profile (x86 and x64)' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697208'
Error: An error occurred trying to download 'http://www.armaleague.com/mac/squint/bin/squint.application'.

sbsmac
Sep 4 2010, 07:49
Strange - it might be that armaleague is struggling a bit under the load. People have reported problems in the past (not a valid win32 application seems to be a result of not successfully downloading the setup.exe file) but generally after a few retries things resolve themselves.

There is an alternate link to the setup file at http://dev-heaven.net/attachments/download/7105/setup.exe. Hopefully this will help. If not let me know.

callihn
Sep 4 2010, 09:27
What about .fsm Mac?

sbsmac
Sep 4 2010, 09:32
Funnily enough I was just looking at fsms yesterday trying to decide whether it was worth the effort to check the embedded sqf ;-)

callihn
Sep 4 2010, 11:31
I'll mention this again too, everytime you open a file it warns you have changes before you can close even when no changes have been made, also I just noticed that when I drag a folder into it nothing happens anymore. The latter appears to be selective though as it's working after I closed it and restarted it. Also it still errors on global variables knowing full and well that it can not read global space and it still counts cautions about comparision strings and case as errors. It also errors as missing semi-colon or operator after the word class for some reason, but that may just be .fsms. Does not seem to even add description.ext to the files?

F2k Sel
Sep 4 2010, 12:42
When trying to install the editor I'm getting a virus warning Heur.Suspicious@<hidden> dotNetFx40_client_setup[1].exe seems to be the file in question.

Has anyone else come across this?

sbsmac
Sep 4 2010, 12:56
dotNetFx40_client_setup is the .Net installer rather than being anything particular to squint. Are you downloading .Net from the microsoft site ?

F2k Sel
Sep 4 2010, 13:03
I was just letting it install from the squint installer, I let it pass as only one virus checker was reporting a problem. After restarting the PC my other AV started to have a fit, some of the shields had been disabled.

It took a while to sort it out but everything seems ok but I'm currently doing a full scan which will take a while.

sbsmac
Sep 4 2010, 13:33
FWIW you got me worried enough to run a full scan on my machine here with AVG. That has come up clean at least.

F2k Sel
Sep 4 2010, 14:21
Nothing has shown up in the full scans I did after installation, I'll keep an eye on things but it was probably a false positive.

---------- Post added at 03:21 PM ---------- Previous post was at 02:48 PM ----------

This will be really useful to check for errors, I'm not sure I can get used to the interface but time will tell.

One problem I'm having right from the get go is that the save filename.sqf As.. isn't working, all it does is overwrite the existing file I don't get the option of changing the name of the file.

Also where is the program located, I've searched for Squint.exe and Mac's Tools but other than finding the Squint save folder and the shortcut nothing else.

Evil_Echo
Sep 4 2010, 15:47
Funnily enough I was just looking at fsms yesterday trying to decide whether it was worth the effort to check the embedded sqf ;-)

Definitely worth the effort.

D3lta
Sep 4 2010, 17:21
sbsmac, Squint is a great tool at now, but needs single and better features, I'll offer some suggestions:



- Vinculate project file to a mission directory from Arma, is better to organize with project file in mission directory
- Recent files/Projects for fast access
- Better indentation levels using tabs (like Visual Studio Editor or notePad++)
- Block indentation using the key TAB and Shift-TAB
- Better Find Function Editor with protection against acidental text change
- fix the syndrome of the code listing scared: the code lines skips arbitrarily, no explication...



Best Regards!!

Muzzleflash
Sep 5 2010, 12:24
So what's new in 106? :)