| 
    
     | 
       
        | Author |  |  
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          In my quest to develop something like this, I have started by creating a PSP page to let you select an existing macro and display it on a web page.
           | Posted: February 26 2006 at 20:41 | IP Logged |   |  
           | 
 |  
 PSP Macro Listing
 
 Download it, put it in your powehome/web folder, and access it with your browser.
 
 Commments/suggestions appreciated.
 |  
        | Back to Top |       |  
        |  |  
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Tony,
           | Posted: February 27 2006 at 11:44 | IP Logged |   |  
           | 
 |  
 This is looking good.  Checked it out last night and it's a great start.
 
 Dave.
 
 |  
        | Back to Top |       |  
        |  |  
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Based on your response in another thread, I am trying to pull the commands from a table, but I'm missing something here...
           | Posted: February 27 2006 at 20:47 | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | <% ph_rtne( ph_sqlselect( 1, "select id, sequence, skip_line, type, type_data1, type_id, type_number, send_keys from macrodetail where id='[LOCAL3]' order by 1")) %> 
 <% ph_rtne( ph_sqlselect( 2, "select ddnumval, dddisplay, ddtype from dropdowns where ddtype = 12 order by ddnumval")) %>
 
 <tr><th>Seq</th><th>Skip</th>& lt;th>Command</th><th>Data</th><th&g t;ID</th><th>Value</th><th>Send  Keys/Dim/TTS/Formula</th></tr>
 <% ph_rtne( ph_forloopwinc( "ph_concatvar( 1, 2, if( mod( ph_getvar_n( 1, 1), 2)=0, '<tr valign=top bgcolor=white><td>', '<tr valign=top bgcolor=#c0dcc0><td>') + ph_getdata( 1, ph_getvar_n( 1, 1), 2) + '0</td><td>' + case( ph_getdata( 1, ph_getvar_n( 1, 1), 3) when '0' then 'O' else 'X') + '</td><td>' + ph_getdata( 1, ph_getvar_n( 1, 1), 4)  + '</td><td>' + ph_getdata( 1, ph_getvar_n( 1, 1), 5) + '</td><td>' + ph_getdata( 1, ph_getvar_n( 1, 1), 6) + '</td><td>' + ph_getdata( 1, ph_getvar_n( 1, 1), 7) + '</td><td>' + ph_getdata( 1, ph_getvar_n( 1, 1), 8) + '</td></tr>~r~n')", 1, [SQLROWS1], 1, 1) + ph_sqldestroy( 1) + ph_sqldestroy( 2)) %>
 <% ph_getvar_s(1, 2)%>
 |  |  |  
 Now, if...
 
 
 
| Code: 
 
    
    | 
      
       | ph_getdata( 1, ph_getvar_n( 1, 1), 4) |  |  |  is the command type, why doesn't...
 
 
 
| Code: 
 
    
    | 
      
       | ph_getdata( 2, ph_getdata( 1, ph_getvar_n( 1, 1), 4), 2) |  |  |  pull the appropriate string?
 |  
        | Back to Top |       |  
        |  |  
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Tony,
           | Posted: February 28 2006 at 14:57 | IP Logged |   |  
           | 
 |  
 I didnt trace it through completely, but I think I know what the problem is.  The second SQL pulls a list of all macro commands, but if Im not mistaken, there may be skipped commands so you cant assume that the row number matches the command number.
 
 What you may find easier is to combine your SQL statements into one by joining the tables like this:
 
 
 
| Code: 
 
    
    | 
      
       | select  md.id,md.sequence,md.skip_line,dd.dddisplay,md.type_data1,md .type_id,md.type_number,md.send_keys  from macrodetail md,dropdowns dd where md.id='[LOCAL3]' and md.type = dd.ddnumval and dd.ddtype = 12 |  |  |  
 This should make this type of thing much easier for you.
 
 Dave.
 
 |  
        | Back to Top |       |  
        |  |  
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Wow. I'll say that's easy!
           | Posted: February 28 2006 at 23:45 | IP Logged |   |  
           | 
 |  
 Link updated!
 |  
        | Back to Top |       |  
        |  |  |  |