cyberchief Posted January 30, 2006 Report Share Posted January 30, 2006 Need help desperately. I am trying to cut up a length of text to type into fields that have a maximum length of 36 characters including spaces. Problem is that I don't want to cut up words (text can change depending on the project). So, I need to find the "space" prior to the 36 characters, and use that positioning to only input that text up to the space. Example, take the following text: "If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead." and make it look like this: If you are reading this from anemail system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead. Here is the code... but it isn't working and I have been hammering at this for a while trying to figure it out. <TVAR2:11:01:-If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with><REP3:08:000002:000001:0011:1:01:T11><IFVAR2:1:11:1:><BREAK><ENDIF><TMVAR2:10:20:11:001:036:><REP3:01:000001:000001:00036:0:01:><TMVAR2:10:50:20:001:001:><TMVAR2:08:51:50:000:000:><TMVAR2:11:20:00:001:001:><ENDREP><IVAR2:01:13:51: ><NMVAR:02:01:2:0000036:1:0000001><NMVAR:02:01:1:0000001:2:0000001><TMVAR2:10:55:11:001:N01:><TMVAR2:11:11:00:001:N01:><TVAR2:51:01:><TEXTTYPE:%T55%><DELAY:.2><TEXTTYPE:<NUMENTER>><ENDREP> Variable Set String %T11% "-If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with" Repeat Until %T11% <> %T11% If Variable %T11% = "" Break End If Variable Modify String: Copy Part of %T11% to %T20% Repeat Start (Repeat 36 times) Variable Modify String: Copy Part of %T20% to %T50% Variable Modify String: Append %T50% to %T51% Variable Modify String: Delete Part of %T20% Repeat End Variable Set Integer %N1% from Position of Text in Variable %T51% Variable Modify Integer: %N1% = 36 - %N1% Variable Modify Integer: %N1% = %N1% - 1 Variable Modify String: Copy Part of %T11% to %T55% Variable Modify String: Delete Part of %T11% Variable Set String %T51% "" Text Type: %T55% Delay 0.2 Seconds Text Type: <NUMENTER> Repeat End Any ideas what I am doing wrong? I am sure it is simple... just can't find it. Quote Link to comment Share on other sites More sharing options...
joe Posted January 30, 2006 Report Share Posted January 30, 2006 Hello Cyberchief! This should should handle the parsing but it does not do the text typing. Change as needed. // Initialize variables Variable Set %T13% to ASCII Char of 013 Variable Set %T1% to ASCII Char of 010 Variable Modify String: Append %T1% to %T13% // Set the main string variable Variable Set String %T10% "If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead." Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% Variable Set String %T11% "" // Process the whole string Repeat Until %N10% <= 36 // Get the next 36 characters Variable Modify String: Copy Part of %T10% to %T1% Repeat Start (Repeat 36 times) // Find first "space" (right-to-left) Variable Modify String: Copy Part of %T1% to %T2% If Variable %T2% = " " Repeat Exit End If Variable Modify String: Delete Part of %T1% Repeat End // Strip value from main string and reset the length variable Variable Modify String: Trim %T1% Replace "%T1%" with "" in %T10% Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% // Save this string Variable Modify String: Append "%T1%%T13%" to %T11% Repeat End // Save the remainder Variable Modify String: Trim %T10% Variable Modify String: Append "%T10%%T13%" to %T11% // Here it is. Variable Modify String: Save %T11% to Clipboard Macro Stop <REM2:Initialize variables><ASCIIC:13:1:013><ASCIIC:1:1:010><TMVAR2:08:13:01:000:000:><REM2:><REM2:Set the main string variable><TVAR2:10:01:If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead.><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><TVAR2:11:01:><REM2:><REM2:Process the whole string><REP3:08:000006:000002:0010:0:01:36><REM2:><REM2:Get the next 36 characters><TMVAR2:10:01:10:001:036:><REP3:01:000036:0000-1:00036:1:01:><REM2:><REM2:Find first "space" (right-to-left)><TMVAR2:10:02:01:N01:001:><IFVAR2:1:02:1: ><EXITREP><ENDIF><TMVAR2:11:01:00:N01:001:><ENDREP><REM2:><REM2:Strip value from main string and reset the length variable><TMVAR2:01:01:00:000:000:><TMVAR2:21:10:00:000:000:%T1%><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><REM2:><REM2:Save this string><TMVAR2:07:11:00:000:000:%T1%%T13%><ENDREP><REM2:><REM2:Save the remainder><TMVAR2:01:10:00:000:000:><TMVAR2:07:11:00:000:000:%T10%%T13%><REM2:><REM2:Here it is.><TMVAR2:16:11:00:000:000:><MSTOP> Quote Link to comment Share on other sites More sharing options...
cyberchief Posted January 30, 2006 Author Report Share Posted January 30, 2006 Thanks Joe! I will take a look at this. You know... as much as I THINK I know about writing macros... I am always humbled when I see your responses and try and work with them. I may be writing back with questions after I go through this. Thanks again! Quote Link to comment Share on other sites More sharing options...
cyberchief Posted January 30, 2006 Author Report Share Posted January 30, 2006 Joe, Excellent code... But I do have to apologize that I didn't explain what i am actually doing... so that is my fault. What this code is doing is typing into fields that are only 36 characters in length. not on a notepad or anything. So I actually have to tab to the field, type out up to 36 characters, go to another field, type the word "more", hit enter, then tab tothe field again and repeat. This has to repeat for as many lines as needed. That is why I had the "repeat" that would type out the first line and hit enter, and repeat with the next line. I am going to look at your code and see if there is any way to add the repeat in there. If you have any ideas, can you let me know? Thanks much!!! Quote Link to comment Share on other sites More sharing options...
cyberchief Posted February 7, 2006 Author Report Share Posted February 7, 2006 Joe, Hope you are still around... Still need assistance with this one. I am not familiar with ACSII format... but hopefully soon will have time to investigate. What I need to do is: get the first line of 36 character (whole words) and type into a text feild. Tab to another field, type a code, hit enter, wait for fields to clear (thats what hitting enter does, does not go to the next line underneath... just sends the current data and clears the field) and repeat. So, basically, I need to cut up and type that information IN the loop that is breaking out the characters. Not append them to another variable with the carriage returns. Let me know if you have any ideas. If not, no prob. Thanks for any help!!! Quote Link to comment Share on other sites More sharing options...
joe Posted February 10, 2006 Report Share Posted February 10, 2006 David - It is just a matter of using Text Type in place of the Append command and then adding the code that does your tabbing, code typing, clearing, and waiting. Here ya go! // Initialize variables Variable Set %T13% to ASCII Char of 013 Variable Set %T1% to ASCII Char of 010 Variable Modify String: Append %T1% to %T13% // Set the main string variable Variable Set String %T10% "If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead." Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% Variable Set String %T11% "" // Process the whole string Repeat Until %N10% <= 36 // Get the next 36 characters Variable Modify String: Copy Part of %T10% to %T1% Repeat Start (Repeat 36 times) // Find first "space" (right-to-left) Variable Modify String: Copy Part of %T1% to %T2% If Variable %T2% = " " Repeat Exit End If Variable Modify String: Delete Part of %T1% Repeat End // Strip value from main string and reset the length variable Variable Modify String: Trim %T1% Replace "%T1%" with "" in %T10% Variable Modify String: Trim %T10% Variable Set Integer %N10% from Length of Variable %T10% // Type the current string Text Type: %T1% // PLACE YOUR CODE TO <TAB> AND SO FORTH HERE Repeat End // Save the remainder Variable Modify String: Trim %T10% // Type the current string Text Type: %T10% // PLACE YOUR CODE TO <TAB> AND SO FORTH HERE Macro Stop <REM2:Initialize variables><ASCIIC:13:1:013><ASCIIC:1:1:010><TMVAR2:08:13:01:000:000:><REM2:><REM2:Set the main string variable><TVAR2:10:01:If you are reading this from an email system other than Lotus Notes, there are Lotus Notes document links that will not work on your email system. URL links (text that starts with "http") are provided instead.><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><TVAR2:11:01:><REM2:><REM2:Process the whole string><REP3:08:000006:000002:0010:0:01:36><REM2:><REM2:Get the next 36 characters><TMVAR2:10:01:10:001:036:><REP3:01:000036:0000-1:00036:1:01:><REM2:><REM2:Find first "space" (right-to-left)><TMVAR2:10:02:01:N01:001:><IFVAR2:1:02:1: ><EXITREP><ENDIF><TMVAR2:11:01:00:N01:001:><ENDREP><REM2:><REM2:Strip value from main string and reset the length variable><TMVAR2:01:01:00:000:000:><TMVAR2:21:10:00:000:000:%T1%><TMVAR2:01:10:00:000:000:><IVAR2:10:12:10><REM2:><REM2:Type the current string><TEXTTYPE:%T1%><REM2:><REM2:PLACE YOUR CODE TO <TAB> AND SO FORTH HERE><REM2:><ENDREP><REM2:><REM2:Save the remainder><TMVAR2:01:10:00:000:000:><REM2:><REM2:Type the current string><TEXTTYPE:%T10%><REM2:><REM2:PLACE YOUR CODE TO <TAB> AND SO FORTH HERE><REM2:><MSTOP> Quote Link to comment Share on other sites More sharing options...
cyberchief Posted February 15, 2006 Author Report Share Posted February 15, 2006 Joe, That was perfect. I don't know why... but it seems that I tried this exact same thing but could not get it to work. I must have had something missing. Anyway, thanks for your time and assistance!!! Quote Link to comment Share on other sites More sharing options...
joe Posted February 16, 2006 Report Share Posted February 16, 2006 David - I lost count of the many times the same thing has happened to us. It must be a professional problem. Meaning that our beginner's luck ran out years ago You are in good company! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.