Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,806,560 Members 54,287 Now Online
XDA Developers Android and Mobile Development Forum

MortScript examples accumulation

Tip us?
 
michoob
Old
#4241  
michoob's Avatar
Retired Recognized Developer
Thanks Meter 63
Posts: 1,270
Join Date: Dec 2008
Location: Brussels

 
DONATE TO ME
Hi mariasx, I don't think your problem comes from the "foreach record in Array", but rather from the massive amount of string operations (Replace, Find, SubStr, Split)!
There is definitly something to do around these string operations...

I do not have much time to spend, but an idea might be trying to recode the whole script to avoid using all these string operations, but to use the IniRead and IniWrite functions and to store your data in a .ini file, where you would have a .ini section per your current csv column, and a code for each task... not sure if it would be better.
Device: HTC Touch HD
ROM: kwbr 5.6 :: Sense 2.5 :: wm6.5 (21914)
ROM Date: 11/17/2010
OS: CE OS 5.2.21914
Radio: 1.17.25.09

My contributions: IPTWeather (weather in iPhoneToday and/or S2U2), iniEditor, Reviewed Cendaryn's MyMetroLock
If you like my work, buy me a beer :


tronikos iPhoneToday 1.5.3 changelogs
Latest tronikos' iPhoneToday (v1.5.4 = v1.5.3 without bugs)
 
mariasx
Old
#4242  
Junior Member
Thanks Meter 1
Posts: 13
Join Date: Jul 2008
Location: Bratislava
Hi michoob

1. Thank you for answer. I did not change data(Strings operations). I tried to display different lists(Foreach record in Array) and performance was decreasing. So I think there is problem with memory and I do not know how to handle it.

2. How do you think data should be designed in INI file?

like that?

[lorem]
desc=Nam posuere iaculis
status=n
context=movies

[ipsum]
desc=pretium eu leo
status=n
context=movies
------------------------------
Mortscript V4.3b15, HTC Touch Diamond 1
 
michoob
Old
#4243  
michoob's Avatar
Retired Recognized Developer
Thanks Meter 63
Posts: 1,270
Join Date: Dec 2008
Location: Brussels

 
DONATE TO ME
1. I do not say you change the data, but you obviousely use string operations for the display in your Foreach loop, and that is why performance is decreasing. And it is not decreasing because of memory, but rather because of CPU...
You might try to use MortScript 4.3b15 if not already the case, because it is faster.

2. Nope, I would rather see it like this, but then, the data is of course less readable than a csv file (but do yo care?):
[reference]
1=lorem
2=ipsum

[desc]
1=Nam posuere iaculis
2=pretium eu leo

[status]
1=n
2=n

[context]
1=movies
2=movies
Device: HTC Touch HD
ROM: kwbr 5.6 :: Sense 2.5 :: wm6.5 (21914)
ROM Date: 11/17/2010
OS: CE OS 5.2.21914
Radio: 1.17.25.09

My contributions: IPTWeather (weather in iPhoneToday and/or S2U2), iniEditor, Reviewed Cendaryn's MyMetroLock
If you like my work, buy me a beer :


tronikos iPhoneToday 1.5.3 changelogs
Latest tronikos' iPhoneToday (v1.5.4 = v1.5.3 without bugs)
 
RoryB
Old
#4244  
RoryB's Avatar
Recognized Developer
Thanks Meter 683
Posts: 2,776
Join Date: Sep 2008
Location: Lexington

 
DONATE TO ME
Default Sad to go

My Fuze no longer works. I currently have a loner Infuse 4G, but do not know what I will end up with.

I will not be able to continue development of Mortscripts, etc.

Sorry to go, but it has been fun.

I'll keep watching to see if anything comes up I need to respond to.
AT&T Samsung Galaxy S III running Quantum.4
Read About Me to see what I am working on & following like CHTS, Reminder and AppTask widgets, and CHT basic function tweaks. Also, Fixed CHT restarting when you have no tasks.
Mortscript | iniEditor | regEditor| MortScripts to toggle settings
Samsung Infuse 4G drowned. If you have one check out Scott's CM10 or CM10PA Firmware
ATT Fuze (HTC RAPH110) with Energy ROM: Energy.RAPHAEL.29022.Sense2.5.Cookie.2.0.Jul.06
HTC Wizard|See about me for my ROM collection and other work
 
mariasx
Old
#4245  
Junior Member
Thanks Meter 1
Posts: 13
Join Date: Jul 2008
Location: Bratislava
Default so long RoryB

RoryB, it's a pity see You leaving. What will be Mortscript replacement for you? Are you looking for it?
------------------------------
Mortscript V4.3b15, HTC Touch Diamond 1
 
RoryB
Old
#4246  
RoryB's Avatar
Recognized Developer
Thanks Meter 683
Posts: 2,776
Join Date: Sep 2008
Location: Lexington

 
DONATE TO ME
Quote:
Originally Posted by mariasx View Post
RoryB, it's a pity see You leaving. What will be Mortscript replacement for you? Are you looking for it?
The loaner is a Droid, but I do not know what I'll end up with. So I am in limbo.
AT&T Samsung Galaxy S III running Quantum.4
Read About Me to see what I am working on & following like CHTS, Reminder and AppTask widgets, and CHT basic function tweaks. Also, Fixed CHT restarting when you have no tasks.
Mortscript | iniEditor | regEditor| MortScripts to toggle settings
Samsung Infuse 4G drowned. If you have one check out Scott's CM10 or CM10PA Firmware
ATT Fuze (HTC RAPH110) with Energy ROM: Energy.RAPHAEL.29022.Sense2.5.Cookie.2.0.Jul.06
HTC Wizard|See about me for my ROM collection and other work
 
bbobeckyj
Old
#4247  
bbobeckyj's Avatar
Senior Member
Thanks Meter 6
Posts: 961
Join Date: Aug 2006
Location: dorset
Quote:
Originally Posted by RoryB View Post
The loaner is a Droid, but I do not know what I'll end up with. So I am in limbo.
Sell it on eBay and get yourself whatever you want.
 
mariasx
Old
#4248  
Junior Member
Thanks Meter 1
Posts: 13
Join Date: Jul 2008
Location: Bratislava
Quote:
Originally Posted by RoryB View Post
The loaner is a Droid, but I do not know what I'll end up with. So I am in limbo.
I have an Android device too. For a six months I am still looking for Mortscript replacement for Android. I found some candidate like BASIC! + SQL. Even better could be Frink Programming Language but it still do not adequately meets Mortscript quallities.

I need one programming language for phone and desktop and Java is not what I am talking about. Adobe Flex is also an possible alternative.

Maybe Windows 8 will be salvation because it is Intel and also Arm processor compatible. I am curious.
------------------------------
Mortscript V4.3b15, HTC Touch Diamond 1
 
lesscro
Old
#4249  
lesscro's Avatar
Senior Member
Thanks Meter 1,745
Posts: 3,331
Join Date: Jul 2007
Location: paris

 
DONATE TO ME
Thx for all RoRyB... you help lot of time and insipre me more than lot of time...

See yaaa in other place...
 
jwoegerbauer
Old
(Last edited by jwoegerbauer; 9th April 2012 at 07:56 AM.)
#4250  
jwoegerbauer's Avatar
Senior Member
Thanks Meter 196
Posts: 568
Join Date: Jul 2009
Location: Bavaria (Germany)
Lightbulb Searching for control structure errors

I have a script with ~3,300 lines. Script is organized in parts MAIN and SUBS. Suddenly got error "Sub must not be in control structure". I know this errror only occurs if If/EndIf is not matching. Re-reading the script again and again I didn't find the missing EndIf. Hence decided to write a small script as listet next to make searching for the error cause easier
Code:
local()
Thoght I should share this script.

Tags
mortscript, mortscript examples
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes