Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Posts posted by paul

  1. Speaking personally...

    I abhor long complex IF statements, and I strongly dislike the lack of a true ElseIf.

     

    I can do this in many languages:

    If condition1

    --do this

    ElseIf (or even Else if) condition2

    --do that

    Else

    --do something else

    End If (or EndIf)

     

    Here it is clear that the ElseIf and Else statements are true alternatives to condition1.

     

    Whereas ME gives me:

    If condition1

    --do this

    Else

    --If condition2

    ----do that

    --Else

    ----do something else

    --End If

    End If

     

    (Why, oh why, does this forum software suppress leading spaces?)

     

    I therefore have an extra End If. and a misleading indentation for condition2, all of which makes reading it more difficult. And it's not at all clear that condition2 is a true alternative to condition1!

     

    You should never worrry about extra lines of code - readability is a prize really worth chasing. And performance is irrelevant unless you are repeating code hundreds, thousands or more times.

     

    I learnt this valuable lesson back in 1971 when I was just starting to learn how to program. We used a Burroughs COBOL compiler which supported 49 levels of nesting within an IF statement instead of the usual 3. I wrote this horrendous IF statement, which went to 15 or so levels, and took around 60 lines of code. The amazing thing is that it worked first time. Six months later I had to change it, and I could not understand the code, even though I had written it! I ended up recasting and rewriting, and it took longer than the original task!

     

    It's the same in publishing - use more, not less, white space. It makes the text easier to follow and prettier to look at.

  2. Suppose I have Macro1 and Macro2 both of which display a text box so that they don't terminate without human intervention, and I start each running by right-click / run on each macro. According to the documentation, right-clicking on the running man icon should give me a list of the 2 running macros so that I can choose which to terminate. But for me, right or left-clicking on that running man results in both macros being terminated immediately.

     

    ???

  3. It seems that if you have Macro1 which places a value in %Newvar% (defined as a global variable), then calls Macro2 which displays the contents of this variable, this works only if Macro1 is set to wait until Macro2 completes. If you set Macro2 to run asynchronously, then Macro2 will recognize %Newvar% only if:

    - Macro1 saves text variables

    - Macro2 restores text variables

    - Macro2 uses %Newvar% as a global variable

     

    Is that how it's supposed to be?

  4. I have the simplest macro which I'm trying to run from a variable.

     

    Here's the one-line macro"

    Text Box Display: abc

    (a header of abc, the contents of def)

     

    Here's its Direct Editor representation:

    <TEXT BOX DISPLAY Title="abc" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 def\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

    But placing this in T[1], then running the macro in T[1], results in a text box with a header of abc and contents of

    tf1nsinsicpg1252eff0eflang3081onttbl0nilcharset0 Tahoma;1nil Tahoma;iewkind4c1ard0s16 def1 ar

     

    ???

     

    BTW, the example in the help file talks about separator characters, then goes on to provide an example which seems entirely lacking in said separator characters!

     

    Any ideas please?

  5. When you're in v4's Macro Explorer view, and assuming you have more macros than can fit on one screen, does your scroll wheel work? Mine works in Category view, where it does a horizontal scroll, but I get nothing at all in the macros view.

     

    Like you, I also much prefer my trackball. But I fear we're a dying breed, since Logitech has reduced its product range to only 1 or 2 trackball devices.

  6. Here's what I've learnt (I don't use grouping personally as I have 3 monitors and separate taskbars <g>).

     

    First, you can define when grouping should start, i.e. how many windows of the same type need to be open before grouping is used.

    Using RegEdit (I'm assuming XP), navigate to

    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

     

    Create a new DWORD value named TaskbarGroupSize, and give it a value of 2. You'll need to log out and in for this to take effect, but if you now open just 2 explorer windows they'll be grouped.

     

    Once you've got a group, you can right-click on the group button in your taskbar and choose Close Group. Now I'm guessing that it won't be too hard (not tha I've ever tried this) to write a macro that trawls the taskbar for buttons with the words "Windows Explorer" and issues a right-click.

  7. If you are running it on the host machine also, if there is a key conflict, you'll have to suspend one or the other.

    That depends on how Virtual PC works and how well you can get at the virtual environment from the host one.

     

    I use RDP (Remote Desktop). Let's say I have a macro called Fred, identical on both machines, that I want to be able to run on either the host or the remote machine, depending on which has focus. Let's suppose that Fred's hotkey is Ctrl-F on the remote machine, and Win-F on the host.

     

    On my host machine I prefix all "common" macros with this sort of code:

    If Window Title "RemoteMachineSessionname" is on top
     Text Type: Ctrl-F
     Macro Return
    End If

     

    Thus typing Win-F always works on either machine.

     

    This works very well most of the time. Occasionally a particular hotkey may work on the host but not on the remote (and the remote machine cannot use any WIN, and many ALT, hotkey combinations because of my RDP settings).

  8. I reported a bug with the "prompt for value" dialogue where, on my machine, the dialogues would appear garbled and cause the running macro to freeze MEP. I then discovered it was caused by a clash with a tiny utility I use (ResizeEnableRunner) which allows me to resize any dialogue box in almost any application on the fly, but which disagreed violently <g> with MEP. I more or less resigned myself to having to do without this utility since I really didn't expect Insight to worry about such an unimportant problem.

     

    Lo and behold, the problem has been fixed in this new release, which makes me very happy. Thanks to Kevin and his colleagues.

  9. Our PGM Library supports the passing of multiple parameters, as follows:

    Variable set string %xx% "FunctionName, Parameter1, Parameter2, ...ParameterN"

    Write Registry String %xx% to "RegistryValueName"

    Macro Run MacroController

    Thus 3 lines of code are always required for calling a macro requiring 0 to n parameters. Plus, of course, the code to retrieve returned values.

     

    Parameters passed can be named, e.g. Param1=123, Param2=abc, or in sequence.

    The macro MacroController relies on finding a set of definitions at the top of each called macro specifying macro name, macro parameter names, macro parameter shortnames, macro parameter types (e.g. input, output), macro parameter data types (e.g. decimal, integer, string).

    The initial effort to design and establish the required structure (uses the registry) and the macro MacroController was considerable, but it works well and seems quite fast.

  10. Any chance you could post or upload it please? I'd be very interested in studying your approach, although I'm committed to ME Pro now.

    I'll prepare something for you this weekend.

     

    Oops! Once I started looking at the source code (it's complex, using at least 7 other macros), I now find that some of the macros it calls are part of our PGM Library, which means I am not at liberty to release it. My apologies for leading you up the garden path!

  11. Do you have any idea what might be causing that strange message please?

    No, I can't help you there. But, knowing Powerpro a little, I'd bet that these windows are unusual in some way!

     

    BTW, returning on topic, I had no response from you to my question 11 days ago in Post #16 of http://pgmacros.invisionzone.com/index.php?showtopic=3568

    My apologies - I missed that one (I'd been away, and was faced with reading several thousand emails, and several hundred forum messages from various sources!).

     

    I'll prepare something for you this weekend.

×
×
  • Create New...