Skip to content

Commit

Permalink
Finished remark code example so that it generates a valid sql file
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeaster30 committed Apr 15, 2023
1 parent 1544371 commit 0ec4c08
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions docs/examples/remarkcodes/rarc.vore
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
set mmddyyyy to pattern
exactly 2 digit '/' exactly 2 digit '/' exactly 4 digit

set fixDesc to function
set remaining to desc
if remaining == "" then
return desc
end
loop
set a to head remaining
set remaining to tail remaining
if a == "'" then
set result to result + "'"
end
set result to result + a
if remaining == "" then
break
end
end
return result
end

replace all
line start (letter at least 1 digit) = code '\t' (at least 1 not '\n' fewest) = desc '\n'
line start (between 1 and 2 letter at least 1 digit) = code '\t' (at least 1 not '\n' fewest) = desc '\n'
'Start: ' mmddyyyy = startDate
maybe (' | Stop: ' mmddyyyy = stopDate)
maybe (' | Last Modified: ' mmddyyyy = lastModified) '\n'
maybe ('Notes: ' (at least 1 not '\n' fewest) = notes '\n')
with code '\n'
with
"insert into remittanceadviceremarkcodes(code, desc, startdate, stopdate, lastmodifieddate, notes) \n\tvalues ('"
code "', '" fixDesc "', '" startDate "', '" stopDate "', '" lastModified "', '" notes "');\n"

0 comments on commit 0ec4c08

Please sign in to comment.