New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
M3PH
Old
#3761  
M3PH's Avatar
Senior Member
Thanks Meter 225
Posts: 1,290
Join Date: Aug 2007
Location: Gloucester, mebbe

 
DONATE TO ME
Quote:
Originally Posted by grymcent View Post
Hi All

**All Hail MortScript**
Sorry, just needed to get that out of my system.

As an old school programmer I am finding Mortscript pretty easy to learn and implement, so far I have a dozen scripts running and I'm almost looking forward to my next Hard reset so I can try out my Mortscript for rebuilding and setting up my touch pro 2.

Anyway, so far the only bit I am lacking is playing with graphics. I have seen the cimg.exe and the idea of using web pages for graphics but wondered if anyone else had any ideas as both of the above mentioned are tricky & restrictive etc.

Ideally I want a background and click-able images!
All suggestions welcome.

cheers
grymcent
Maybe you could knock up a UI in VB.Net using .Net CF and then use the Process.Start class in a button.click sub function to run the scripts. As long as the .mscr extension is registered in windows it should work. Just an idea.

If you give me the names and paths of the scripts i'll have a look at it over the weekend for you, seeing as i have Visual studio and all the WM SDK and DTK's.

Moving on, i just wanted to say thanks to everyone that helped with my little problem. I spoke to a .Net expert just after i posted earlier and it would appear that what i was trying to achieve is impossbile on windows mobile, atleast until microsoft include the System.ServiceProcess object in .Net CF or mortscript is updated to do something similar. I will look at the other methods posted but not for a little while as i have other things i need to attend to.

Again thank you all and i hope if i stick around not only can i learn something new but also become helpful

ARHD One X Archive Maintainer

 
PDA/Phone
HTC HD2 - Retired
HTC One X....
ARHD One X 12.0.0 (All tweaks included installed. Jotha's APM, Battery mod+EQS)
Kernel: Stock
Hboot: 1.28
Radio: 1.1204.105.14

PC
Intel Core 2 Quad 2.4GHz (o/c to 3.1GHz), 4GB Corsair PC8500 DDR2, EVGA GeForce GTX 560, Asus P5k Premium Wifi-AP, Creative SB X-FI Titanium, Windows 7 Pro x64/openSUSE 12.1 x64


New to XDA? got flamed for a bad post? watch this video
 
RoryB
Old
#3762  
RoryB's Avatar
Recognized Developer
Thanks Meter 622
Posts: 2,602
Join Date: Sep 2008
Location: Lexington

 
DONATE TO ME
Quote:
Originally Posted by grymcent View Post
Hi All

**All Hail MortScript**
Sorry, just needed to get that out of my system.

As an old school programmer I am finding Mortscript pretty easy to learn and implement, so far I have a dozen scripts running and I'm almost looking forward to my next Hard reset so I can try out my Mortscript for rebuilding and setting up my touch pro 2.

Anyway, so far the only bit I am lacking is playing with graphics. I have seen the cimg.exe and the idea of using web pages for graphics but wondered if anyone else had any ideas as both of the above mentioned are tricky & restrictive etc.

Ideally I want a background and click-able images!
All suggestions welcome.

cheers
grymcent
Do you mean something like MortButtons?
Samsung Galaxy S III
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
 
grymcent
Old
(Last edited by grymcent; 20th October 2010 at 08:57 PM.)
#3763  
Senior Member
Thanks Meter 2
Posts: 256
Join Date: Jan 2010
Location: Oakham, UK
Quote:
Originally Posted by RoryB View Post
Do you mean something like MortButtons?
Pretty much exactly what O was thinking of (Doh!, Can't believe I forgot Mort Buttons).
However how can I code to connect to it? I hope that's in the manual.... will spend time reading it and having a go.

---------
Nope can't see a way to sciipt with MortButtons!

cheers
grymcent
"Without tech we wouldn't even have fire, without imagination we wouldn't have cave art, without both we wouldn't have xda-developers!"
HTC Sensation Rooted ARHD Stock ROM, Turbo Boost.
 
M3PH
Old
#3764  
M3PH's Avatar
Senior Member
Thanks Meter 225
Posts: 1,290
Join Date: Aug 2007
Location: Gloucester, mebbe

 
DONATE TO ME
Quote:
Originally Posted by grymcent View Post
Pretty much exactly what O was thinking of (Doh!, Can't believe I forgot Mort Buttons).
However how can I code to connect to it? I hope that's in the manual.... will spend time reading it and having a go.

---------
Nope can't see a way to sciipt with MortButtons!

cheers
grymcent
I could still do something in .net for you.

As for my origninal problem some news. I had a look at a couple of registry comparisons using WinCEregedit and found nothing that was useful relating to the messagingservice (registry service key name msg) nothing is changing in there when it's stopped running or paused. So i have no idea how the taskmanager is able to control it and as i said earlier the functions to do it in .net are missing.

I did, however, look at one of the cab files that is posted along side the messaging client and it seems to set the service to manual activation. I had a peek inside and it is just a single registry value called flags with a dword data value of 4 . Anyway, i got .net cf to edit the right value and with the inclusion of a magic soft reset button it seems to work ok.

I only have one last problem with this project and that is how to create a TreeView based file browser that can export a selected path and filename to box a textbox and a Process.Start call at the same time. If anyone has any ideas on that i'll gladly hear them although i do know this is the wrong place for that sort of question

ARHD One X Archive Maintainer

 
PDA/Phone
HTC HD2 - Retired
HTC One X....
ARHD One X 12.0.0 (All tweaks included installed. Jotha's APM, Battery mod+EQS)
Kernel: Stock
Hboot: 1.28
Radio: 1.1204.105.14

PC
Intel Core 2 Quad 2.4GHz (o/c to 3.1GHz), 4GB Corsair PC8500 DDR2, EVGA GeForce GTX 560, Asus P5k Premium Wifi-AP, Creative SB X-FI Titanium, Windows 7 Pro x64/openSUSE 12.1 x64


New to XDA? got flamed for a bad post? watch this video
 
lesscro
Old
#3765  
lesscro's Avatar
Senior Member
Thanks Meter 1085
Posts: 2,578
Join Date: Jul 2007

 
DONATE TO ME
Default Weather MOd 2011

Hello guys...

i ask your help once again...
I m working an old project designed for iGO8... all GPS users under iGO8 know my weather Mod 1.2...

Finally with help of french skinner i can introduce Weather MOd 2011 with Primo

Script works like a charm BUT:
I use 4.3 b15 and i think this script must be optimized

If you have some suggestions, i can be very happy...
You can participe in Big GPS project... Your name On Hollywoog Bvd... (with Photoshop... )

Weather MOd 2011

Code:
# <!-- THEMECHANGER 2011 (FR) WITH MOONPHASE AND WEATHER (by LeSScro)
# Thanks to Sparcellone & Xerses72 the original ThemeChanger creators.
# Translate and Modified by TiTidom.
# Rebirth by LeSScro (once again, baby)
# <!-- 

ErrorLevel("off")

# <!--Path
exe_path = SystemPath( "ScriptPath" )
Primo_Path = ( "\Storage Card\Primo\" )

# <!--Logs
WriteFile( exe_path \ "logs.txt" , "ThemeChanger On (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , TRUE )

# <!--Check Folder Exist
If ( DirExists (Primo_path) )
  WriteFile( exe_path \ "logs.txt" , "ThemeChanger (" & Primo_Path & ") (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
Else
	WriteFile( exe_path \ "logs.txt" , "ThemeChanger (" & Primo_Path & ") Not Exist (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
	Exit
EndIf


# <!--Time Def
Annee = formattime("Y")
Mois = formattime("m")
Jour = formattime("d")
Heure = formattime("H")
Minutes = formattime("i")
Secondes = formattime("s")

# <!--Directory path
schemepath = IniRead( exe_path \ "themechanger.ini", "Settings", "Schemepath" )
nightskypath = IniRead( exe_path \ "themechanger.ini", "Settings", "Nightskypath" )
dayskypath = IniRead ( exe_path \ "themechanger.ini", "Settings", "Dayskypath" )

# <!--Sseason
lastSeason = IniRead( exe_path \ "themechanger.ini", "Settings", "LastSeason" )
lastWeatherD = IniRead( exe_path \ "themechanger.ini", "Settings", "LastWeatherD" )
LastWeatherN = IniRead( exe_path \ "themechanger.ini", "Settings", "LastWeatherN" )
forceSeason = IniRead( exe_path \ "themechanger.ini", "Settings", "ForceSeason" )
forceWeatherD = IniRead( exe_path \ "themechanger.ini", "Settings", "ForceWeatherD" )
forceWeatherN = IniRead( exe_path \ "themechanger.ini", "Settings", "ForceWeatherN" )

# <!--Lune
LastMoon = IniRead( exe_path \ "themechanger.ini", "Moon", "LastMoon" ) 
LastMoonPhase = IniRead( exe_path \ "themechanger.ini", "Moon", "LastMoonPhase" )
 
# <!--Weather DAY
# 1 = Sun ; 2 = Cloudy ; 3 = Rain ; 4 = Fog ; 5 = Pollution
UTime = TimeStamp()
Auj = FormatTime("Y-m-d",UTime)

Meteo_Jour = IniRead( exe_path \ "meteo.ini", Auj ,"Meteo_DayIcon")
Meteo_Nuit = IniRead( exe_path \ "meteo.ini", Auj ,"Meteo_NightIcon")
MoonPhaseId = IniRead( exe_path \ "meteo.ini", Auj ,"MoonCycle")

If (Meteo_Jour eq "" || Meteo_Jour eq "99")
	# If Day = 0 / SUN 
	Meteo_Jour = "1"
Endif
If (Meteo_Nuit eq "" || Meteo_Nuit eq "99")
	# If Night = 0 / Clear 
	Meteo_Nuit = "1"
Endif

# ID weather
Switch (Meteo_Jour)
	Case ("1")
		MeteoDId = "sun"
	Case ("2")
		MeteoDId = "cloudy"
	Case ("3")
		MeteoDId = "rain"
	Case ("4")
		MeteoDId = "fog"
	Case ("5")
		MeteoDId = "pollution"
EndSwitch
Switch (Meteo_Nuit)
	Case ("1")
		MeteoNId = "clear"
	Case ("2")
		MeteoNId = "cloudy"
	Case ("3")
		MeteoNId = "rain"
	Case ("4")
		MeteoNId = "fog"
	Case ("5")
		MeteoNId = "pollution")
EndSwitch

# <!--Themechanger.ini Parameter

If (LastSeason eq "")
  LastSeason="new"
EndIf
If (LastWeatherD eq "")
  LastWeatherD="sun"
EndIf
If (LastWeatherN eq "")
  LastWeatherN="clear"
EndIf
If (forceSeason eq "")
  forceSeason="no"
EndIf
If (ForceWeatherD eq "")
  ForceWeatherD="sun"
EndIf
If (ForceWeatherN eq "")
  ForceWeatherN="clear"
EndIf
If (schemepath eq "")
  schemepath = "content\scheme\LeSScro"
Endif
If (Nightskypath eq "")
  Nightskypath = "gfx\LeSScro\night"
Endif
If (Dayskypath eq "")
  Dayskypath = "gfx\LeSScro\nay"
Endif
If (LastMoon eq "")
	LastMoon = "99"
EndIf
If (LastMoonPhase eq "")
	LastMoonPhase = "99"
EndIf

# <!--Lunar Phase math

WriteFile( exe_path \ "logs.txt" , "ThemeChanger Calc. Lunar Phase On (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , TRUE )
pos = (MoonPhaseId - 1) / 4

WriteFile( exe_path \ "logs.txt" , "ThemeChanger MoonPhaseId = " & MoonPhaseId & " (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , TRUE )
WriteFile( exe_path \ "logs.txt" , "ThemeChanger MoonPhase = " & pos & " (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , TRUE )

# Retourne une position entre 0 .. 7
# 0 1 6 7 Nouvelle Lune : scheme NewMoon
# 2 3 4 5 Pleine Lune : scheme FullMoon

If (pos > 1 && pos < 6)
  Lune = 1
else
  Lune = 0
Endif
LastMoonPhase = pos
LastMoon = Lune
WriteFile( exe_path \ "logs.txt" , "ThemeChanger Calc. Lunar Phase Off (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , TRUE )

# <!--ForceSeason : Season TEST
If (forceSeason eq "winter" ||  forceSeason eq "summer" || forceSeason eq "spring" || forceSeason eq "autumn")
  SystemSeason = forceSeason
  MeteoDId = forceWeatherD
  MeteoNId = forceWeatherN
  Call ("CopieSaison")
  Call ("CopieLune")
  lastSeason = SystemSeason
  lastWeatherD = MeteoDId
  lastWeatherN = MeteoNId
  Call ("writeini")
  WriteFile( exe_path \ "logs.txt" , "ThemeChanger Off ForceSeason (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , TRUE )
  Exit
EndIf

# <!--Season math
dateSpring="0320"
dateSummer="0621"
dateAutumn="0922"
dateWinter="1221"

SystemSeason = "winter"
dateSeason = Mois & Jour
if (dateSeason >= DateSpring && dateSeason < dateSummer)
    SystemSeason = "spring"
elseif (dateSeason >= DateSummer && dateSeason < dateAutumn)
  	SystemSeason = "summer"
elseif (dateSeason >= dateAutumn && dateSeason < dateWinter)
	SystemSeason = "autumn"
endif

# <!--Copy files and lauch Sub.
Call ("CopieSaison")
Call ("CopieLune")
lastSeason=SystemSeason
lastWeatherD = MeteoDId
lastWeatherN = MeteoNId
Call ("writeini")
WriteFile( exe_path \ "logs.txt" , "ThemeChanger Off OK (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , TRUE )
Exit


# ******************************************************************************
# <!--END MAIN PROG
# ******************************************************************************

# <!--Copy files about Season
Sub CopieSaison
	WriteFile( exe_path \ "logs.txt" , "ThemeChanger Saisons = " & lastSeason & " <> " & SystemSeason & " / lastWeather = " & lastWeatherD & " <> " & MeteoDId & " (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
	If ((lastSeason ne SystemSeason) || (lastWeatherD ne MeteoDId))
		SeasonToCopy = Primo_Path \ schemepath \ SystemSeason \ SystemSeason & "_" & MeteoDId & ".zip"
		If (FileExists ( SeasonToCopy ))
			Copy ( SeasonToCopy , Primo_Path \ "content\scheme\autochanger.zip", true)
			WriteFile( exe_path \ "logs.txt" , "ThemeChanger Saison " & SystemSeason & "_" & MeteoDId & " (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
		Else 
			WriteFile( exe_path \ "logs.txt" , "ThemeChanger ERREUR Fichier Saison " & SystemSeason & "_" & MeteoDId & " MANQUANT ! (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
			Exit
		EndIf
	EndIf 
EndSub

# <!--Copy files about Lunar 
Sub CopieLune
  If (Lune = 1)
  	FullMoonToCopy = Primo_Path \ schemepath \ "fullmoon\fullmoon_" & MeteoNId & ".zip"
  	SkyFullMoonToCopy = Primo_Path \ nightskypath \ MeteoNId \ MeteoNId & "_sky_moon_" & pos & ".bmp"
  	If (FileExists ( FullMoonToCopy ) && FileExists ( SkyFullMoonToCopy ))
  		Copy ( FullMoonToCopy , Primo_Path \ "content\scheme\autochanger-night.zip", true )
  		Copy ( SkyFullMoonToCopy , Primo_Path \ Nightskypath \ "fullmoon_sky.bmp", true )
  		WriteFile( exe_path \ "logs.txt" , "ThemeChanger PleineLune " & MeteoNId & " / Sky " & pos & " (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
  	Else
  		WriteFile( exe_path \ "logs.txt" , "ThemeChanger ERREUR Fichier FullMoon " & MeteoNId & " / Sky " & pos & " MANQUANT ! (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
			Exit
  	EndIf
  ElseIf (Lune = 0)
  	NewMoonToCopy = Primo_Path \ schemepath \ "newmoon\newmoon_" & MeteoNId & ".zip"
  	SkyNewMoonToCopy = Primo_Path \ nightskypath \ MeteoNId \ MeteoNId & "_sky_moon_" & pos & ".bmp"
  	If (FileExists ( NewMoonToCopy ) && FileExists ( SkyNewMoonToCopy ))
  		Copy ( NewMoonToCopy , Primo_Path \ "content\scheme\autochanger-night.zip", true )
  		Copy ( SkyNewMoonToCopy , Primo_Path \ Nightskypath \ "newmoon_sky.bmp", true )
  		WriteFile( exe_path \ "logs.txt" , "ThemeChanger NouvelleLune " & MeteoNId & " / Sky " & pos & " (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
  	Else
  		WriteFile( exe_path \ "logs.txt" , "ThemeChanger ERREUR Fichier NewMoon " & MeteoNId & " / Sky " & pos & " MANQUANT ! (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
			Exit
  	EndIf
  EndIf
EndSub

# <!--Write .ini
Sub WriteIni
	Delete ( exe_path \ "themechanger.ini")
	stringa=";THEMECHANGER 2011 Moon Phase And Weather by LeSScro ©^NL^;Based on TiTiDom Script^NL^^NL^"
	stringa=stringa & "[Settings]^NL^LastSeason=" & lastSeason & "^NL^LastWeatherD=" & lastWeatherD & "^NL^LastWeatherN=" & LastWeatherN & "^NL^ForceSeason=" & forceSeason & "^NL^ForceWeatherD=" & forceWeatherD & "^NL^ForceWeatherN=" & forceWeatherN & "^NL^Schemepath=" & schemepath & "^NL^Nightskypath=" & nightskypath & "^NL^Dayskypath=" & Dayskypath & "^NL^^NL^"
	stringa=stringa & "[Moon]^NL^LastMoon=" & lastMoon & "^NL^LastMoonPhase=" & lastmoonphase & "^NL^^NL^"
	WriteFile( exe_path \ "themechanger.ini" , stringa)
	WriteFile( exe_path \ "logs.txt" , "ThemeChanger WriteIni (" & FormatTime("d/m/Y H:i:s") & ")^NL^" , True )
EndSub
If Zig66 read this... hello bro'...
  • Need Host a Picture for free with Solid link ? Try my IMGhost
  • Need info on GPS software ? iGO is the Best, check here
  • Need a Professional Service for small amount ? Go to my Website
 
grymcent
Old
#3766  
Senior Member
Thanks Meter 2
Posts: 256
Join Date: Jan 2010
Location: Oakham, UK
Quote:
Originally Posted by M3PH View Post
Maybe you could knock up a UI in VB.Net using .Net CF and then use the Process.Start class in a button.click sub function to run the scripts. As long as the .mscr extension is registered in windows it should work. Just an idea.

If you give me the names and paths of the scripts i'll have a look at it over the weekend for you, seeing as i have Visual studio and all the WM SDK and DTK's.
I am interested, but do not understand VB.net etc much.

Here is what I want:

Is there a way of doing an image saet with about 4 layers
Background
Buttons
Text windows
extra image layer

Can all 4 layers be broken up into lots of small squares?
e.g. Layer 1 background image
layer 2 a series of icons, A small icon might be one square, a large might cover 4 squares
Layer 3 allows input boxes, buttons, and status message
Layer 4 image overlays, or button overlays

This gives me massive variation for everything from menu's to Cab selections programs and all sorts of stuff.

Is this possible? (feel free to PM me)

grymcent
"Without tech we wouldn't even have fire, without imagination we wouldn't have cave art, without both we wouldn't have xda-developers!"
HTC Sensation Rooted ARHD Stock ROM, Turbo Boost.
 
RoryB
Old
(Last edited by RoryB; 22nd October 2010 at 12:17 AM.) Reason: Fix error in meteo portion
#3767  
RoryB's Avatar
Recognized Developer
Thanks Meter 622
Posts: 2,602
Join Date: Sep 2008
Location: Lexington

 
DONATE TO ME
Quote:
Originally Posted by lesscro View Post
Hello guys...

i ask your help once again...

If you have some suggestions, i can be very happy...
Code:
########################################################################################
# Replace individual iniread with a foreach loop
########################################################################################
xTheme = exe_path \ "themechanger.ini"
ForEach xkey, xvalue in inikeys (xTheme, "settings" )
 [xkey]=xvalue
EndForEach
########################################################################################
# Gets rid of this
########################################################################################
# <!--Directory path
# schemepath = IniRead( exe_path \ "themechanger.ini", "Settings", "Schemepath" )
# nightskypath = IniRead( exe_path \ "themechanger.ini", "Settings", "Nightskypath" )
# dayskypath = IniRead ( exe_path \ "themechanger.ini", "Settings", "Dayskypath" )
# <!--Sseason
# lastSeason = IniRead( exe_path \ "themechanger.ini", "Settings", "LastSeason" )
# lastWeatherD = IniRead( exe_path \ "themechanger.ini", "Settings", "LastWeatherD" )
# LastWeatherN = IniRead( exe_path \ "themechanger.ini", "Settings", "LastWeatherN" )
# forceSeason = IniRead( exe_path \ "themechanger.ini", "Settings", "ForceSeason" )
# forceWeatherD = IniRead( exe_path \ "themechanger.ini", "Settings", "ForceWeatherD" )
# forceWeatherN = IniRead( exe_path \ "themechanger.ini", "Settings", "ForceWeatherN" )
# <!--Lune
# LastMoon = IniRead( exe_path \ "themechanger.ini", "Moon", "LastMoon" ) 
# LastMoonPhase = IniRead( exe_path \ "themechanger.ini", "Moon", "LastMoonPhase" )
#########################################################################################
Code:
########################################################################################
# Replace individual iniread with a foreach loop 
# this one does not save space unless you add more values to this ini file
########################################################################################
xMeteo = exe_path \ "meteo.ini"
ForEach xkey, xvalue in inikeys (xMeteo, Auj )
 [xkey]=xvalue
EndForEach
########################################################################################
# Gets rid of this
########################################################################################
Meteo_Jour = IniRead( exe_path \ "meteo.ini", Auj ,"Meteo_DayIcon")
Meteo_Nuit = IniRead( exe_path \ "meteo.ini", Auj ,"Meteo_NightIcon")
MoonPhaseId = IniRead( exe_path \ "meteo.ini", Auj ,"MoonCycle")
########################################################################################
Samsung Galaxy S III
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
 
lesscro
Old
#3768  
lesscro's Avatar
Senior Member
Thanks Meter 1085
Posts: 2,578
Join Date: Jul 2007

 
DONATE TO ME
@ RoryB...
Once again bro'... nice idea...
i save 1 sec on calc with 1st method for each...

Quote:
>>(21/10/2010 19:50:21)<<
ThemeChanger Activated
>>(21/10/2010 19:50:21)<<
ThemeChanger Directory :
\Storage Card\Primo\
>>(21/10/2010 19:50:21)<<
ThemeChanger Calc. Lunar Phase Start
>>(21/10/2010 19:50:21)<<
ThemeChanger MoonPhaseId = 12
>>(21/10/2010 19:50:21)<<
ThemeChanger MoonPhase = 2
>>(21/10/2010 19:50:21)<<
ThemeChanger Calc. Lunar Phase End
ThemeChanger Saisons = autumn <> autumn / lastWeather = sun <> sun (21/10/2010 19:50:21)
>>(21/10/2010 19:50:22)<<
ThemeChanger PleineLune cloudy / Sky 2
ThemeChanger WriteIni (21/10/2010 19:50:22)
>>(21/10/2010 19:50:22)<<
ThemeChanger Finish
About Meteo.ini...
i have lot of entry and i need specify/read only 4 line (RED)

Quote:
[Infos]
DateMaJ=21/10/10 12:18:28
CityCode=EUR|FR|FR005|DIJON
City=Dijon
State=France (Burgundy)

[2010-10-21]
SunR=08:08
SunS=18:40
Low=1
Hi=9
DayT=Sunshine, but chilly
NightT=Cold with increasing clouds
MoonPhase=Waxing Gibbous
MoonCycle=12
Meteo_DayIcon=1
Meteo_NightIcon=2
Thx for this precious second, On PNA or Old PDA.. i think this script can be fullfilled between 5 to 11 sec...

If you have another idea... i m ready to test...
  • Need Host a Picture for free with Solid link ? Try my IMGhost
  • Need info on GPS software ? iGO is the Best, check here
  • Need a Professional Service for small amount ? Go to my Website
 
mariasx
Old
#3769  
Junior Member
Thanks Meter 1
Posts: 13
Join Date: Jul 2008
Location: Bratislava
Question Empty variable not allowed

I have CSV database "test.csv". The structure is:
title~description~status~category

test.csv:
Code:
Prague~100 tower city~n~@travel
Rome~must see~n~@travel
how to reduce weight~~s~@find
Bratislava~small capitol~s~@travel
how to get a new job~~s~@find
in another "context.csv" are categories:
Code:
@travel
@find
I want to parse "test.csv" into separate Arrays grouped by Categories.
Result should look like this:

@travel:
Code:
1~Prague
2~Rome
4~Bratislava
@find:

Code:
3~how to reduce weight
5~how to get a new job
Here is script code:

Code:
sp = SystemPath("ScriptPath")

MainDataIndex = 1

SourceData = ReadFile( sp\"test.csv")
MainData = Split( SourceData, "^NL^")

ContextData  = ReadFile( sp\"context.csv")
ContextData = Split( ContextData, "^NL^")

For i=1 to (ElementCount(ContextData))


   ForEach record in array(MainData)
      If (Part(record, "~", 4) eq ContextData[i]) 
            [ContextData[i]&"String"] = MainDataIndex & "~" & Part(record, "~", 1) & "^NL^"
            Message( [ContextData[i]&"String"])
      EndIf
      MainDataIndex = MainDataIndex+1   
   EndForEach
   
Next
Script is returning error "Empty variable not allowed". Maybe I do not understand how "References ([variable name])" working.

Any suggestion will be apreciated.
 
RoryB
Old
(Last edited by RoryB; 22nd October 2010 at 01:49 AM.)
#3770  
RoryB's Avatar
Recognized Developer
Thanks Meter 622
Posts: 2,602
Join Date: Sep 2008
Location: Lexington

 
DONATE TO ME
Try remove the @ since MortScript might think you are calling a subscript.

Also this:

Code:
sp = SystemPath("ScriptPath")

MainDataIndex = 1

SourceData = ReadFile( sp\"test.csv")
MainData = Split( SourceData, "^NL^")

ContextData  = ReadFile( sp\"context.csv")
ContextData = Split( ContextData, "^NL^")

For i=1 to (ElementCount(ContextData))

n=1
   ForEach record in array(MainData)
      If (Part(record, "~", 4) eq ContextData[i]) 
            [ContextData[i]][n] = MainDataIndex & "~" & Part(record, "~", 1)
        
      EndIf
      MainDataIndex = MainDataIndex+1   
n = n+1
   EndForEach
   
Next
Samsung Galaxy S III
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

Tags
mortscript, mortscript examples