Browse Source

Also add a StrToVersion to ISPP.

Martijn Laan 4 years ago
parent
commit
2988fcd6c8
3 changed files with 26 additions and 2 deletions
  1. 8 0
      Files/ISPPBuiltins.iss
  2. 16 1
      Projects/ISPP/Help/ispp.xml
  3. 2 1
      whatsnew.htm

+ 8 - 0
Files/ISPPBuiltins.iss

@@ -190,6 +190,14 @@
   Str(Version >> 48 & 0xFFFF) + "." + Str(Version >> 32 & 0xFFFF) + "." + \
   Str(Version >> 48 & 0xFFFF) + "." + Str(Version >> 32 & 0xFFFF) + "." + \
   Str(Version >> 16 & 0xFFFF) + "." + Str(Version & 0xFFFF)
   Str(Version >> 16 & 0xFFFF) + "." + Str(Version & 0xFFFF)
 
 
+#define StrToVersion(str Version) \
+  Local[0] = Version, \
+  Local[1] = Int(DeleteToFirstPeriod(Local[0])), \
+  Local[2] = Int(DeleteToFirstPeriod(Local[0])), \
+  Local[3] = Int(DeleteToFirstPeriod(Local[0])), \
+  Local[4] = Int(Local[0]), \
+  PackVersionComponents(Local[1], Local[2], Local[3], Local[4])
+  
 #define EncodeVer(int Major, int Minor, int Revision = 0, int Build = -1) \
 #define EncodeVer(int Major, int Minor, int Revision = 0, int Build = -1) \
   (Major & 0xFF) << 24 | (Minor & 0xFF) << 16 | (Revision & 0xFF) << 8 | (Build >= 0 ? Build & 0xFF : 0)
   (Major & 0xFF) << 24 | (Minor & 0xFF) << 16 | (Revision & 0xFF) << 8 | (Build >= 0 ? Build & 0xFF : 0)
 
 

+ 16 - 1
Projects/ISPP/Help/ispp.xml

@@ -1499,7 +1499,22 @@ The list of options is provided at the end of this topic.</para>
 					<para>Declared in &builtins;.</para>
 					<para>Declared in &builtins;.</para>
 				</description>
 				</description>
 				<section title="See also">
 				<section title="See also">
-					<para><synel><link href="PackVersionNumbers">PackVersionNumbers</link></synel>, <synel><link href="PackVersionComponents">PackVersionComponents</link></synel></para>
+					<para><synel><link href="StrToVersion">StrToVersion</link></synel>, <synel><link href="UnpackVersionNumbers">UnpackVersionNumbers</link></synel>, <synel><link href="UnpackVersionComponents">UnpackVersionComponents</link></synel></para>
+				</section>
+			</topic>
+			<topic id="StrToVersion">
+				<title>StrToVersion</title>
+				<section title="Prototype">
+					<pre>
+						<line><b>int</b> StrToVersion(<b>str</b> Version)</line>
+					</pre>
+				</section>
+				<description>
+					<para>Returns the specified string (in "0.0.0.0" format) as a packed version.</para>
+					<para>Declared in &builtins;.</para>
+				</description>
+				<section title="See also">
+					<para><synel><link href="VersionToStr">VersionToStr</link></synel>, <synel><link href="PackVersionNumbers">PackVersionNumbers</link></synel>, <synel><link href="PackVersionComponents">PackVersionComponents</link></synel></para>
 				</section>
 				</section>
 			</topic>
 			</topic>
 			<topic id="EncodeVer">
 			<topic id="EncodeVer">

+ 2 - 1
whatsnew.htm

@@ -30,13 +30,14 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
 
 
 <p><a name="6.1.3"></a><span class="ver">6.1.3-dev </span><span class="date">(?)</span></p>
 <p><a name="6.1.3"></a><span class="ver">6.1.3-dev </span><span class="date">(?)</span></p>
 <ul>
 <ul>
+  <li>Compiler IDE change: <i>Fix:</i> Autocomplete support for event functions listed some procedures as functions.</li>
   <li>Pascal Scripting changes:
   <li>Pascal Scripting changes:
   <ul>
   <ul>
     <li>Added new <tt>ItemFontStyle</tt> and <tt>SubItemFontStyle</tt> properties to the <tt>TNewCheckListBox</tt> support class. See the <i><a href="https://jrsoftware.github.io/issrc/Examples/CodeClasses.iss">CodeClasses.iss</a></i> example script for an example.</li>
     <li>Added new <tt>ItemFontStyle</tt> and <tt>SubItemFontStyle</tt> properties to the <tt>TNewCheckListBox</tt> support class. See the <i><a href="https://jrsoftware.github.io/issrc/Examples/CodeClasses.iss">CodeClasses.iss</a></i> example script for an example.</li>
     <li>Added new <tt>IsMsiProductInstalled</tt> and <tt>StrToVersion</tt> support functions.</li>
     <li>Added new <tt>IsMsiProductInstalled</tt> and <tt>StrToVersion</tt> support functions.</li>
   </ul>
   </ul>
   </li>
   </li>
-  <li>Compiler IDE change: <i>Fix:</i> Autocomplete support for event functions listed some procedures as functions.</li>
+  <li>ISPP change: Added new <tt>StrToVersion</tt> support function.</li>
 </ul>
 </ul>
 
 
 <p>Contributions via <a href="https://github.com/jrsoftware/issrc" target="_blank">GitHub</a>: <b>Thanks to Sergii Leonov and Dom Gries for their contributions.</b></p>
 <p>Contributions via <a href="https://github.com/jrsoftware/issrc" target="_blank">GitHub</a>: <b>Thanks to Sergii Leonov and Dom Gries for their contributions.</b></p>