Macroman
-
Posts
11 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Macroman
-
-
Can you upload the fix?
Thanks!
-
8 minutes ago, terrypin said:
I think I see what’s wrong and I’ll fix when I get back to my PC in the morning.
Terry23:45 UK time, from my iPad.
Thank you terry!
-
10 hours ago, terrypin said:
Here's one way to do it:
// Two cols of info, User ID and Name, separated by a tab, are stored in G:\Traffic\IBS\Other\id.txt. This macro prompts for a user id. If it is found it displays the name. Otherwise it displays an appropriate message and ends the macro. // I've defined Use ID as a string variable. That not only allows future flexibility but simplifies the script. And unless you intend to do arithmetic on the User ID it's unnecessary to set it as an integer. // Note: I prefix my string variables with 't' (for 'text'), and integer variables with 'n' (for 'number'). Variable Set String %tUser%: Prompt ASCII File Begin Process: "G:\Traffic\IBS\Other\id.txt" (Tab Delimited Text (.txt)) If Variable %tUser% Equals "%tLine[1]%" // This is a match. Text Box Display: User %tUser% is: Macro Stop Else Repeat Exit End If ASCII File End Process Text Box Display: User %tUser% is:
CODE:
<COMMENT Value="Two cols of info, User ID and Name, separated by a tab, are stored in G:\\Traffic\\IBS\\Other\\id.txt.\r\nThis macro prompts for a user id. If it is found it displays the name. Otherwise it displays an appropriate message and ends the macro."/> <COMMENT Value="I've defined Use ID as a string variable. That not only allows future flexibility but simplifies the script. And unless you intend to do arithmetic on the User ID it's unnecessary to set it as an integer."/> <COMMENT Value="Note: I prefix my string variables with 't' (for 'text'), and integer variables with 'n' (for 'number')."/> <COMMENT/> <VARIABLE SET STRING Option="\x01" Destination="%tUser%" Prompt="Enter the target User ID." Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/> <ASCII FILE BEGIN PROCESS Filename="G:\\Traffic\\IBS\\Other\\id.txt" Format="Tab" Start_Record="1" Process_All="TRUE" Records="1" Variable="%tLine%" Start_Index="1" Parse_Blank_Lines="FALSE" Clear_Array="TRUE"/> <IF VARIABLE Variable="%tUser%" Condition="\x00" Value="%tLine[1]%" IgnoreCase="FALSE" _COMMENT="This is a match."/> <TEXT BOX DISPLAY Title="User %tUser% is:" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 %tLine[2]%\\f1 \r\n\\par }\r\n" Left="689" Top="334" Width="378" Height="138" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO STOP/> <ELSE/> <REPEAT EXIT/> <END IF/> <ASCII FILE END PROCESS/> <TEXT BOX DISPLAY Title="User %tUser% is:" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Not on record.\\f1 \r\n\\par }\r\n" Left="689" Top="334" Width="378" Height="138" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
Terry, UK
Terry, I tried the sample macro you provided and it works for the entry on line 1, but not line 2 or 3 any thoughts? Do you think it'll be better to use a csv file? Thanks
-
Terry, I tried the sample macro you provided and it works for the entry on line 1, but not line 2 or 3 any thoughts?
-
Thanks all, I will give these methods a try!
-
It's a text file, hasn't much been made yet as I'm trying to figure out how to snag those details. CSV would be better to organize in my opinion if that's doable. I'm currently using macro express pro
I basically want two columns one with names and one with the numeric user id, and the same with an acronym macro which has two columns of text. I'm just at home so I don't have access to the macro but I believe it would need a redesign based off what Cory was saying
-
It's basically as such
Column 1 Column 2
12345 Smith, John
44921 Jones, Mike
etc. there is about 40 of these
also with acronyms, same thing
Column 1 with the acronym
Column 2 with the explanation
-
I had tried using that, but it didn't seem to work. No rush but if you could elaborate in the future, that'd be great!
-
I'm also not married to the idea of using a text file, if it's possible to snag the information from column 1 and column 2 csv that would probably be more ideal.
-
So i'm trying to make this macro look up a user id number from the text file and display the name associated to it. If the number doesn't exist, it works correctly. If it finds the number it displays the whole file. Any ideas on how to make it just display the person that is associated to it?
Also I want to do the same with acronyms, will the same method still work
I appreciate the help
Thanks
Text file lookup and display name associated to number
in Macro Express and Macro Express Pro
Posted
Hey nevermind, I found the edited and it works great, thank you Terry!