Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r35 - trunk

genelib
Discussion topic

Back to topic list

svn commit: r35 - trunk

Author lotec
Full name Jan Bogaerts
Date 2006-03-30 08:47:29 PST
Message Author: LoTeC
Date: 2006-03-30 08:47:29-0800
New Revision: 35

Modified:
   trunk/Application.gen
   trunk/CommControls.gen
   trunk/Extract.gen
   trunk/stdio.gen

Log:
-Some small changes in various files because the interpreted vars for the target and platform have changed.
-Extract.gen: added exp for extracting the file extention

Modified: trunk/Application.gen
Url: http://genelib.tigri​s.org/source/browse/​genelib/trunk/Applic​ation.gen?view=diff​&rev=35&p1=tr​unk/Application.gen​&p2=trunk/Applica​tion.gen&r1=34​&r2=35
====================​====================​====================​==================
--- trunk/Application.gen (original)
+++ trunk/Application.gen 2006-03-30 08:47:29-0800
@@ -97,7 +97,7 @@
      >|
  is |<
          //check if windows or linux, generate accordingly
- #[#<- CurOs == 'win32'->
+ #[#<- Target == 'win32'->
              entry #(self.Name) (aInstance: THandle, hPrevInstance: THandle, lpszCmdLine: char^, nCmdShow: int ): int stdcall =
            #<-->
              #addError('GuiEntry: platform not yet supported')

Modified: trunk/CommControls.gen
Url: http://genelib.tigri​s.org/source/browse/​genelib/trunk/CommCo​ntrols.gen?view=diff​&rev=35&p1=t​runk/CommControls.ge​n&p2=trunk/CommC​ontrols.gen&r1=3​4&r2=35
====================​====================​====================​==================
--- trunk/CommControls.gen (original)
+++ trunk/CommControls.gen 2006-03-30 08:47:29-0800
@@ -568,7 +568,7 @@
      Command: int
      State: byte
      Style: byte
-#[#<-CurOs == 'Win64'->
+#[#<-target == 'Win64'->
      Reserved: byte@6 // padding for alignment
  #<-->
      Reserved: byte@2 // padding for alignment

Modified: trunk/Extract.gen
Url: http://genelib.tigri​s.org/source/browse/​genelib/trunk/Extrac​t.gen?view=diff&​rev=35&p1=trunk/​Extract.gen&p2=t​runk/Extract.gen​&r1=34&r2=35
====================​====================​====================​==================
--- trunk/Extract.gen (original)
+++ trunk/Extract.gen 2006-03-30 08:47:29-0800
@@ -20,9 +20,10 @@
 
 space Extract =
  //files and directories
- exp FileName(aVal: string&): string static //extract the file name from aVal, returns new string
- FileDir(aVal: string&): string static //extract the file dir from aVal, returns new string
- LastDelimiterPos(aVal: string&): int static
+ exp FileName(aVal: string&): string static //extract the file name from aVal, returns new string
+ FileDir(aVal: string&): string static //extract the file dir from aVal, returns new string
+ Extention(aVal: string&): string static //returns the extention of a filename specified in aVal, returns a new string
+ LastDelimiterPos(aVal: string&): int static //internally used to determin the last delimitir(\ or :) in a file name
 ;
 
 exp Extract.LastDelimiterPos(aVal: string&): int
@@ -72,15 +73,18 @@
    return(iRes)
 ;
 
-//process extractTest =
-// entry main(Argc: int, Argv: char^^): int
-// type win32Console
- // exp
-//;
-
-//exp ExtractTest.main(Argc: int, Argv: char^^): int
-//=
-// iTest: string
-// iTest = 'c:\test\jan.txt'
-// iTest = Extract.FileDir(iTest)
-//;
\ No newline at end of file
+exp Extract.Extention(aVal: string&): string
+=
+ //start at the end, go back untill we find a '.' or are at the beginning
+
+ iRes: string
+ iChar: aval.entity
+
+ {<-aval \ iChar->
+ [<-iChar.entity == "."-> break]
+ }
+ [<-iChar.cursor == nil-> iRes = aVal
+ <--> iRes = aVal.subString(iChar.pos + 1, aVal.NrRecords - iChar.pos - 1)
+ ]
+ return(iRes)
+;
\ No newline at end of file

Modified: trunk/stdio.gen
Url: http://genelib.tigri​s.org/source/browse/​genelib/trunk/stdio.​gen?view=diff&re​v=35&p1=trunk/st​dio.gen&p2=trunk​/stdio.gen&r1=34​&r2=35
====================​====================​====================​==================
--- trunk/stdio.gen (original)
+++ trunk/stdio.gen 2006-03-30 08:47:29-0800
@@ -178,7 +178,7 @@
          iChar = readChar
       }
       //if this is for windows, read 1 more char cause newline is actually 2 chars
- #[#<-CurOs == 'Win32' || CurOs == 'Win32Console'->
+ #[#<-target == 'Win32' || target == 'Win32Console'->
            readchar
       #]
     <-->

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r35 - trunk lotec Jan Bogaerts 2006-03-30 08:47:29 PST
Messages per page: