[Swift-commit] r3460 - trunk/src/org/griphyn/vdl/karajan/lib/swiftscript

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Jul 22 11:55:44 CDT 2010


Author: jonmon
Date: 2010-07-22 11:55:44 -0500 (Thu, 22 Jul 2010)
New Revision: 3460

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
Log:
o swift/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
  -- Fixed @totint fucntion. This function failed if passed a string that started with a "."



Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2010-07-22 16:35:55 UTC (rev 3459)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2010-07-22 16:55:44 UTC (rev 3460)
@@ -368,10 +368,14 @@
 			InvalidPathException {
 		String inputString = TypeUtil.toString(PA_INPUT.getValue(stack));
 		int i = inputString.indexOf(".");
-		if( i >= 0 )
+		if( i > 0 )
 		{
 			inputString = inputString.substring(0, i);
 		}
+		if( i == 0 )
+		{
+		    inputString = "0";
+		}
 		DSHandle handle = new RootDataNode(Types.INT);
 		handle.setValue(new Double(Integer.parseInt(inputString)));
 		handle.closeShallow();




More information about the Swift-commit mailing list