Jump to content
Macro Express Forums

kcrane

Members
  • Posts

    5
  • Joined

  • Last visited

kcrane's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Aha, thank you, that should work fine. I should have realized that! As for the problem I posted in my edit above, I realized my mistake and it's corrected now. Thanks again for your aid With my Case/Switch problems in the OP, I've gotten around them by doing a horribly long 4000 line macro with an if statement for every person. At least it'll work for the moment.
  2. Hmm, the problem is that %T[1]% is the variable that determines where the specific entry goes in the .ini file. For example, the way it works is I run a separate macro that asks me to type a name. If I type 'Johnson', I then use shortkeys like /name and /address for it to type out the name and address belonging to the name Johnson in the .ini file. The .ini looks like this: [Johnson] firstname=Jim lastname=Johnson address= 555 5th St. <------ these are all fields I can type a /add or /surname shortkey for So if I overwrite %T[1]% with nothing for each multiple choice menu, it will then no longer have the client name stored to know where to input the changes. I suppose the solution to that might be to have it store 2 separate variables, both for the same name, have it clear one when I need it cleared and then have it pull the second variable back into it to keep it on track? Let me know if you have another way... I'm under the impression clearing the variable actually clears it and it can't be restored again with the restore variable command. -------- Edit --------- I thought I'd add this as another example of a Case/Switch problem, this time with an error probably unrelated to usage, but maybe not. <VARIABLE RESTORE Option="\x00"/> <SWITCH Variable="%name%"/> <CASE Value="Kyle Crane"/> <VARIABLE SET STRING Option="\x07" Destination="%surname%" Filename="T:\\Claims\\Specialized Services\\Rehab Services & OOP Claims\\Rehab Operations\\Shared\\Macro Express\\kylecrane.ini" Key="%T[1]%" Value="surname"/> <END CASE/> <END SWITCH/> When I run this macro, for the case that %name% has the name Kyle Crane in it, it's supposed to set a variable to an INI file entry. The %T[1]% is the client name from another macro. Anyway, it gives this error: Could not write to the ini file. Access violation at address 7C912C36 in module NTDLL.dll. Write of address 0040621D. Line number 4. Everything was so simple earlier when this was all run locally, but now I'm accessing files stored on a networked drive and I'm running into all sorts of problems.
  3. The %T[50]% becomes a first name and surname, just like this: John Doe I was going to just use the environment variable %username%, but when I started getting the crash I took that out as a suspect. Here was how my last attempt looked, using %name% in place ot $T[50]% (bearing in mind that there are about 25 if statements before the final end statement, for each menu option). Seeing as how you are very knowledgable, would you also happen to know to make it so that once multiple options are checked in a menu, the next time the menu runs it doesn't leave the check-marks there from the previous selections? <SWITCH Variable="%name%"/> <CASE Value="Kyle Crane"/> <MULTIPLE CHOICE MENU Style="\x01" Result="\x00" Dest="%T[10]%" Title="%T[1]% - Update Database" Prompt="Select all fields you wish to create/update for: %T[1]%." Options="surname\r\nfist name\r\nclaim number\r\nexposure\r\ndate of birth\r\ndate of loss\r\naddress\r\nphone numbers\r\nfax number\r\ninjury type\r\ngeneral practitioner information\r\nplaintiff council information\r\noccupational therapist information\r\nphysiotherapist information\r\ncounsellor information\r\nchiropractor information\r\nspeech-language pathologist information\r\nhead office examiner\r\nclaims adjuster\r\ncommittee\r\ntort (change to yes, no or settled)\r\nooptort (change to yes, no or settled)\r\nalerts (important things to remember about client)\r\ntaxi (yes or no if account does/does not exist)\r\nPHN #\r\npersonal contact\r\nPart 7 Only (select yes or no)" Left="334" Top="255" Monitor="0" Width="619" Height="389" OnTop="TRUE"/> <IF VARIABLE Variable="%T[10]%" Condition="\x06" Value="a" IgnoreCase="TRUE"/> <VARIABLE SET STRING Option="\x01" Destination="%T[11]%" Prompt="New Surname:" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/> <VARIABLE SET STRING Option="\x00" Destination="%T[2]%" Value="surname"/> <VARIABLE MODIFY STRING Option="\x13" Destination="%T[11]%" Filename="T:\\Claims\\Specialized Services\\Rehab Services & OOP Claims\\Rehab Operations\\Shared\\Macro Express\\kylecrane.ini" Key="%T[1]%" Value="%T[2]%"/> <END IF/> <IF VARIABLE Variable="%T[10]%" Condition="\x06" Value="b" IgnoreCase="TRUE"/> <VARIABLE SET STRING Option="\x01" Destination="%T[11]%" Prompt="New First Name:" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/> <VARIABLE SET STRING Option="\x00" Destination="%T[2]%" Value="firstname"/> <VARIABLE MODIFY STRING Option="\x13" Destination="%T[11]%" Filename="T:\\Claims\\Specialized Services\\Rehab Services & OOP Claims\\Rehab Operations\\Shared\\Macro Express\\kylecrane.ini" Key="%T[1]%" Value="%T[2]%"/> <END IF/> <END CASE/> <END SWITCH/> Thanks for helping me out so much!
  4. I think by my omission of a lot of the lines and writing it out in lazy form, I've made it look more confusing than it is. When I get to my home computer I'll take a screenshot and upload it give a better picture, but here's how it looks without the case/switch options: <VARIABLE RESTORE Option="\x01"/> <MULTIPLE CHOICE MENU Style="\x01" Result="\x00" Dest="%T[10]%" Title="%T[1]% - Update Database" Prompt="Select all fields you wish to create/update for: %T[1]%." Options="surname\r\nfist name\r\nclaim number\r\nexposure\r\ndate of birth\r\ndate of loss\r\naddress\r\nphone numbers\r\nfax number\r\ninjury type\r\ngeneral practitioner information\r\nplaintiff council information\r\noccupational therapist information\r\nphysiotherapist information\r\ncounsellor information\r\nchiropractor information\r\nspeech-language pathologist information\r\nhead office examiner\r\nclaims adjuster\r\ncommittee\r\ntort (change to yes, no or settled)\r\nooptort (change to yes, no or settled)\r\nalerts (important things to remember about client)\r\ntaxi (yes or no if account does/does not exist)\r\nPHN #\r\npersonal contact\r\nPart 7 Only (select yes or no)" Left="201" Top="155" Monitor="0" Width="619" Height="389" OnTop="TRUE"/> <IF VARIABLE Variable="%T[10]%" Condition="\x06" Value="a" IgnoreCase="TRUE"/> <VARIABLE SET STRING Option="\x01" Destination="%T[11]%" Prompt="New Surname:" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/> <VARIABLE SET STRING Option="\x00" Destination="%T[2]%" Value="surname"/> <VARIABLE MODIFY STRING Option="\x13" Destination="%T[11]%" Filename="T:\\Claims\\Specialized Services\\Rehab Services & OOP Claims\\Rehab Operations\\Shared\\Macro Express\\kylecrane.ini" Key="%T[1]%" Value="%T[2]%"/> <END IF/> <IF VARIABLE Variable="%T[10]%" Condition="\x06" Value="b" IgnoreCase="TRUE"/> <VARIABLE SET STRING Option="\x01" Destination="%T[11]%" Prompt="New First Name:" Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/> <VARIABLE SET STRING Option="\x00" Destination="%T[2]%" Value="firstname"/> <VARIABLE MODIFY STRING Option="\x13" Destination="%T[11]%" Filename="T:\\Claims\\Specialized Services\\Rehab Services & OOP Claims\\Rehab Operations\\Shared\\Macro Express\\kylecrane.ini" Key="%T[1]%" Value="%T[2]%"/> <END IF/> To answer your other question, the macro that determines the name of the person running it is done separately at the start of the work day, ideally. The variable is saved. At the beginning of this macro, variables are restored so that it should carry that information over. Then I would have a case for each name that could potentially be stored in that variable. Case 'Kyle' would run the macro with my own .ini file, while Case 'Liz' would run it with her's. I hope that makes more sense. If it doesn't, I'll try to get a screenshot up.
  5. Here's the simple run down of what I'm trying to accomplish. I have a database (a simple .ini file) with information stored for all my clients. Other people have their own databases, and I need Macro Express to recognize who they are so that it runs off their specific database. What I've got going (and it works fine without switch/case) is a macro that updates information based on a multiple choice selection and prompts. My problem is I need a case for each person, where the destination .ini file will be changed based on who they are. Here's how it basically looks... Multiple Choice Menu: %T[1] ## This menu is a list of demographics you can choose to modify--name, age, address, etc Switch (%T[50]%) ## T50 is where each case will be, determined by a separately-run macro (John Doe, Jack Black, etc). Case: John Doe If Variable %T[10]% contains "a", prompt for the 'a' field, then set the 'a' field to a variable Variable modify string - send the contents entered into a specific .ini entry End if After this, I repeat the If/End If statements for each field. When all fields are complete End Case End Switch Am I using the Switch/Case fields incorrectly? The problem I run into is that when I run this macro, it simply crashes with this error: The instruction at 0x7c1b21a referenced memory at 0x00000010. The memory could not be written. If I remove the Case/Switch from it, it runs fine. Thanks for any help here.
×
×
  • Create New...