We need a better way...

Post your requests and ideas on the future development of mikroPascal PRO for PIC.
Post Reply
Author
Message
LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

We need a better way...

#1 Post by LGR » 13 Feb 2013 21:21

The Ethernet and Net_Ethernet libraries rely on long constant strings built through massive concatenations for the HTML. This is clumsy, and tedious when you have quote marks inside of the string (which you sometimes need to do when embedding javascript). I don't know the best way to implement this, but there should be a way to set a constant string equal to an external text file, and ideally, to automatically count bytes, so as to be able to declare it as a constant string. Possibly some kind of compiler directive to declare the constant string by name, and set both the size and the content to point to an external text file.
If you know what you're doing, you're not learning anything.

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: We need a better way...

#2 Post by dejan.odabasic » 14 Feb 2013 13:59

Hello,

You can transform your HTML+JavaScript code to mikroPascal string using any advanced plain text editor(for example Notepad++) which have Find and Replace option.

First you need to search for all quote marks in text and replace them with
' + Chr(39) + '

Second, add ' at the beginning of every line and add ' + at the end of every line, except the last one, at the end of last line add only ;

When you add this string to mikroPascal, and if size of string is lager then declared, compiler will produce error and tell you what is actual size of a string.

Best regards.

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

Re: We need a better way...

#3 Post by LGR » 14 Feb 2013 16:34

I understand that, but it's still tedious if you are making small alterations. It would seem like some sort of external reference (or even some tool) would be much more satisfactory.

The same is true of numerical arrays. I don't know what you did to create the jpg files in the example, but it would be much more satisfactory if it were possible to either convert them with a tool, or include them as constant arrays with some sort of external reference.

Note that such a tool or directive would be hardware independent and only slightly different for the three languages.
If you know what you're doing, you're not learning anything.

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: We need a better way...

#4 Post by dejan.odabasic » 18 Feb 2013 14:34

Hello,

Thank you for your suggestions, I'll present them to our developers and they will consider development of such tools.

Best regards.

Post Reply

Return to “mikroPascal PRO for PIC Wish List”