Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Input and Output
#1
I am using the following macro with the input


str author_input
str title_input
str v_input
str t_input
str y_input
str p_input
if(!inp(author_input "Author:") or !author_input.len) ret
if(!inp(title_input "Title:") or !title_input.len) ret
if(!inp(v_input "Vol:") or !v_input.len) ret
if(!inp(t_input "Town:") or !t_input.len) ret
if(!inp(y_input "Year:") or !y_input.len) ret
if(!inp(p_input "PageNos:") or !p_input.len) ret
outp "("
outp author_input
outp title_input
outp "v"
outp v_input
outp "["
outp t_input
outp ","
outp y_input
outp "]"
outp "p"
outp p_input
outp ")"

The output looks like this:
(Author Title Vol 3 [Town, 1947 ] p 22 )

at the end they each insert an extra space how do i get rid of that space?

I have tried to put in keystrokes and also tried the alternate command paste
#2
I would also like to be able to output some of the material in italics
#3
Macro Macro2
Code:
Copy      Help
out F"({author_input} {title_input} v{v_input}[{t_input},{y_input}] p{p_input})"
;outp F"({author_input} {title_input} v{v_input}[{t_input},{y_input}] p{p_input})"
#4
Thanks much but have you figured out how to add italics
#5
Does the F come from formatstring ?
#6
F allows to insert variables in string.

If working with MS Word, it's better to use key, not paste, because Word often modifies pasted text, eg trims spaces.

Macro Macro1991
Code:
Copy      Help
act "Word"

str author_input
str title_input
str v_input
if(!inp(author_input "Author:") or !author_input.len) ret
if(!inp(title_input "Title:") or !title_input.len) ret
if(!inp(v_input "Vol:") or !v_input.len) ret
author_input.trim
title_input.trim
v_input.trim
key F"({author_input} " Ci (title_input) Ci F" v{v_input})"
;Ci is Ctrl+I - a keyboard shortcut to make text italic in Word
#7
Great Solution Thanks for the lesson in Custom Format. What a powerful KEY to use inside Word. I see all kinds of uses. Big Grin
#8
Comments about following in next post

int w1b=act(win("RE: Order for Homiletic(s)Journal - Message (Plain Text) " "rctrl_renwnd32"))
'CH ;; Ctrl+Home
'Cf ;; Ctrl+F
5 win("Find and Replace" "bosa_sdm_Mso96")
'"church:" Y ;; "Title:" Enter
'Z ;; Esc
act w1b
key R ;; Right
'SE ;; Home Shift+End
g_sC3.getsel
'HSE ;; Home Shift+End
key X ;; Delete
#9
I am trying to use the following but I need to have the

g_sC3.getsel
'HSE ;; Home Shift+End
key X ;; Delete

by passed if nothing found.
#10
Macro Macro1447
Code:
Copy      Help
int wNotFound=0
wNotFound=wait(2 WA win("Microsoft Office Word" "#32770" "" 1)) ;;wait for "not found" message box max 2 s
err
if wNotFound
,clo wNotFound
,out "not found"
,

This works with MS Office 2003 Outlook. With your program version may need different code.
#11
I understand but I want to skip code and not to print out not found.


Forum Jump:


Users browsing this thread: 1 Guest(s)