Changeset 116 for trunk/src/org/expeditee/actions/Simple.java
- Timestamp:
- 07/02/08 17:26:51 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Simple.java
r115 r116 323 323 // an item without a link signals to run the current frame 324 324 if (current.getLink() == null) { 325 // Make a copy but hide it325 // Make a copy but hide it 326 326 current = current.copy(); 327 327 current.setLink(DisplayIO.getCurrentFrame().getName()); … … 352 352 */ 353 353 public static void DebugFrame(Text current, float pause, Color color) { 354 if (isProgramRunning()){354 if (isProgramRunning()) { 355 355 stop(); 356 356 } … … 412 412 context.getPointers().setObject(SPointer.framePrefix + varName, 413 413 frame); 414 context.getPointers().setObject(SPointer.itemPrefix + varName, 415 frame.getTitleItem()); 414 416 context.getPrimitives().add(SString.prefix + varName, 415 417 new SString(frame.getName())); … … 481 483 if (_step) { 482 484 DisplayIO.removeFromBack(); 483 if (DisplayIO.getCurrentFrame() != current.getParent())485 if (DisplayIO.getCurrentFrame() != current.getParent()) 484 486 DisplayIO.setCurrentFrame(current.getParent()); 485 487 } … … 766 768 // Check if the user wants to display a message 767 769 // Check for set statements 770 } else if (tokens[0].startsWith("search")) { 771 if (tokens[0].equals("searchstr")) { 772 assertExactParametreCount(tokens, 5); 773 String searchStr = context.getPrimitives().getStringValue( 774 tokens[1]); 775 String pattern = context.getPrimitives().getStringValue( 776 tokens[2]); 777 String[] result = searchStr.split(pattern, 2); 778 boolean bFound = result.length > 1; 779 context.getPrimitives().setValue(tokens[3], 780 new SBoolean(bFound)); 781 if (bFound) { 782 context.getPrimitives().setValue(tokens[4], 783 new SInteger(result[0].length() + 1)); 784 context.getPrimitives().setValue(tokens[5], 785 new SInteger(searchStr.length() - result[1].length())); 786 } 787 }else if (tokens[0].equals("searchitem")) { 788 assertExactParametreCount(tokens, 5); 789 assertVariableType(tokens[1], 1, SPointer.itemPrefix); 790 Text searchItem = (Text)context.getPointers().getVariable(tokens[1]).getValue(); 791 String searchStr = searchItem.getText(); 792 String pattern = context.getPrimitives().getStringValue( 793 tokens[2]); 794 String[] result = searchStr.split(pattern, 2); 795 boolean bFound = result.length > 1; 796 context.getPrimitives().setValue(tokens[3], 797 new SBoolean(bFound)); 798 if (bFound) { 799 // context.getPrimitives().setValue(tokens[4], 800 // new SInteger(1)); 801 context.getPrimitives().setValue(tokens[4], 802 new SInteger(result[0].length() + 1)); 803 // context.getPrimitives().setValue(tokens[6], 804 // new SInteger(1)); 805 context.getPrimitives().setValue(tokens[5], 806 new SInteger(searchStr.length() - result[1].length())); 807 } 808 } 768 809 } else if (tokens[0].startsWith("set")) { 769 810 if (tokens[0].equals("set")) { … … 794 835 assertExactParametreCount(tokens, 3); 795 836 796 Map<String, String> map = (Map<String,String>) context.getPointers().getVariable(tokens[1])797 .get Value();837 Map<String, String> map = (Map<String, String>) context 838 .getPointers().getVariable(tokens[1]).getValue(); 798 839 String attribute = context.getPrimitives().getStringValue( 799 840 tokens[2]);
Note:
See TracChangeset
for help on using the changeset viewer.