|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Join Date: Aug 2021
Posts: 65
Rep Power: 6 ![]() |
Hello,
I am trying to save an image sequence to then convert into an animation. I have something like this: (let((i 0)) i (do ((x 1 (- x 0.2))) ((< x -2)) (ti-menu-load-string (format #f "/display/objects/edit totalpressure-contour surfaces-list z=~a ()" x)) (ti-menu-load-string (format #f "/display/objects/display totalpressure-contour")) (ti-menu-load-string (format #f "/display/save-picture ./pictures/totalpressure-contour-~a" i)) (set! i (+ i 1)) ) ) Here, it saves the images like this: totalpressure-contour 1 ,.., totalpressure-contour 12 However this mucks up the order when it gets to 10 for the image sequencing software I use. How can I add zeroes to get a format like 0001 0002 ,.., 0023 etc.? Thanks! |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,841
Rep Power: 68 ![]() ![]() ![]() |
Some examples to motivate your fmt
Code:
(format #t "~5,'*d" 12) -| ***12 (format #t "~5,'0d" 12) -| 00012 (format #t "~3d" 1234) -| 1234 |
|
|
|
|
|
|
|
|
#3 | |
|
Member
Join Date: Aug 2021
Posts: 65
Rep Power: 6 ![]() |
Quote:
> (format #t "~5,'0d" 12) Error: format: unassigned variable format (~,) Error Object: #\, I tried some similar commands yesterday that I found on various forums but couldn't get the hang of it. Any ideas? |
||
|
|
|
||
|
|
|
#4 |
|
Member
Join Date: Aug 2021
Posts: 65
Rep Power: 6 ![]() |
I got it to work:
(format #f "the string is ~04d" 1) returns: the string is 0001 If anyone could explain the #f (I've seen it's boolean?) and what it means in scheme I'd be very grateful! |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error: Out of scheme heap space | SSG_NJ | FLUENT | 4 | April 24, 2025 07:24 |
| Crank Nicolson scheme implemented wrong? | rajibroy | OpenFOAM Programming & Development | 10 | May 5, 2020 10:57 |
| can you tell me best gradient, pressure & momentum order selection in fluent | sanjiiv | FLUENT | 6 | February 14, 2020 07:07 |
| 2nd order upwind scheme (Fluent and CFX) | Far | FLUENT | 0 | May 22, 2011 02:50 |
| extrapolation in MUSCL scheme | Chandra | Main CFD Forum | 6 | February 14, 2007 12:21 |