Use of Square Brackets in filenames

Report any Hollywood bugs here
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Use of Square Brackets in filenames

Post by djrikki »

Hi Andreas,

Spotted a bug, if you do something like this:

Code: Select all

createtextobject(x,files$[x-1], #LEFT, 270)
If a filename stored in the string contains a [ or ] I get an HollywoodPlayer error: Text format tag after square bracket not recognized.

I stumbled across this error by accident whilst navigating through a file lister I am producing, directory was full of ADFs and some contain these pair of brackets. I cannot see a way around this problem at a coder's end.

On a similar trail of thought is it possible to Trap HollywoodPlayer errors at all? Can't find anything in the documentation. Foreinstance handling uninitialised arrays often throws up an exception, it would be nice to contain these.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Use of Square Brackets in filenames

Post by airsoftsoftwair »

That's not a bug, RTFM :)
User avatar
Tuxedo
Posts: 345
Joined: Sun Feb 14, 2010 12:41 pm

Re: Use of Square Brackets in filenames

Post by Tuxedo »

You have to parse the filenames manually to check for [ or ][ since they was special chars for Hollwood...
As Andrear spoke... RTFM :)
For example

Print/Format Tags page...
Simone"Tuxedo"Monsignori, Perugia, ITALY.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Use of Square Brackets in filenames

Post by djrikki »

I am having a hard time RTFM as the Find menu of Amigaguide seems to be permanently disabled lol. So am resorting to hitting Index/Help a lot of the time.

Progressing well with my project though Tuxedo, you don't need to worry about looking at the sourcecode I sent you I got it sorted.
Last edited by djrikki on Fri Apr 29, 2011 1:21 am, edited 1 time in total.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
Tuxedo
Posts: 345
Joined: Sun Feb 14, 2010 12:41 pm

Re: Use of Square Brackets in filenames

Post by Tuxedo »

Unfortunately find dont works in AmigaGuide docs :(
However reading te infos for every command used will simpify your life a lot!
Trust me! :)

If you've solved your troubles in your project I'm happy for you :)
Also that evening I was really busy since tomorrow I will depart...

Good Work!
Simone"Tuxedo"Monsignori, Perugia, ITALY.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Use of Square Brackets in filenames

Post by djrikki »

Is this the kind of solution you meant? Seems to pass through the code okay, of course its caused something else to break now :lol: :lol:

Code: Select all


							local file

							if findstr(files$[x-1],"\[") > 0 or findstr(files$[x-1],"\]") > 0
								file = replacestr(files$[x-1], "\[", "\[[")
								file = replacestr(file, "\]", "\]]")
								
								debugprint(file)
							else
								file = files$[x-1]
							endif
							
							debugprint(x)
							
							if scrollbar = false											
								createtextobject(x,file, #LEFT, 290)
								displaytextobject(x+1,475,topy + (x*20))			
							else
								createtextobject(x,file, #LEFT, 270)
								displaytextobject(x+1,490 - 20,topy + (x*20))
							endif
Last edited by djrikki on Fri Apr 29, 2011 1:55 am, edited 1 time in total.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Use of Square Brackets in filenames

Post by djrikki »

Project progress so far:

http://www.lakewebdesign.co.uk/lookinggood.jpg

Panel: If Push4Dock is installed the 5 drawer icons appear below the device list, click one, content appears to the right, atm no list so just 17 items appear so far, item can be selected (multi-select not implemented yet), drawers can be entered, Parent icon works.

Devices in Panel: Atm clicking drives will show DH0 and DH1 etc... clicking them does nothing atm.. still to do

Icons across top: Parent icon is the only one that does something atm.

Selecting a file: It is now possible to highlight a file (text turns red) if its a recognised type eg. a picture, a text file, an amigaguide file... etc etc an icon appears in the top right-hand corner - user can then click this to for example open a .txt/.readme in notepad, open an image in the in-built editor for quick-rotation/whatever, open a pdf in amipdf, open a amigaguide in multiview, open an icon in iconedit.

I want to be able to open htmls as well using OpenURL - but when I run OpenURL in the shell it just says: Could not load browser... so gotta find out why!?!? Clue anyone?

Might add a basic music player in the application as well, depends what Hollywood supports, if its just stop and start, then just a start/button, otherwise as much as possible.

Video playback is a bit trickier.. do I default to using DVPlayer? I assume every OS4 user should have that installed.. if not why not!

--

In the end I want to be able to offer the source code so any Hollywood Developer can pick it up and call it from their own code with minimum arguments: Open/Save file, Window Title, Filter files by extension, Single/Multi-select file in lister.

I was thinking that an Applet would be useful?

Andreas with an applet can a Hollywood Developer call an applet with arguments and also Return variables back to the code? Again perhaps I sure hunt through the guide somemore, but I seem to remember offhand the page had very little info about applets.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Use of Square Brackets in filenames

Post by airsoftsoftwair »

djrikki wrote: Andreas with an applet can a Hollywood Developer call an applet with arguments and also Return variables back to the code? Again perhaps I sure hunt through the guide somemore, but I seem to remember offhand the page had very little info about applets.
Yes, developers can just @INCLUDE applets into their scripts as if they were plain code. Thus, it's also possible to call applet functions and return values etc. No problem at all. Allanon is also doing this with some of his libs AFAIR.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Use of Square Brackets in filenames

Post by djrikki »

Hi,

Thanks for the response. Another question regarding applets then, should I give any constants or variables (those which should not be available to the coder) a unique name - in other words do they filter through to the main program? In a similar vein - loaded brushes - say the applet populated the brushes 1-100 with AISS icons would they be accessible from the main program?

Code: Select all

/* Small example of what I mean */

include "example.applet"

displaybrush(#ARROWUP, other args) ; #ARROWUP exists in example.applet does the coder actually have access to that constant?

; lets load another brush

loadbrush(#APPLETOFFSET, #AISSFOLDER .. "anothericon", other args) ; load a brush into the first position available after those loaded by the applet, and use #AISSFOLDER a const declared in example.applet

I trust your answer will be yes - seems logical.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Use of Square Brackets in filenames

Post by airsoftsoftwair »

djrikki wrote: I trust your answer will be yes - seems logical.
And "yes" it is :)
Post Reply