comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Format query
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Format query [message #45938] Tue, 18 October 2005 16:00
neon is currently offline  neon
Messages: 9
Registered: October 2005
Junior Member
I came across this problem.

i could not use fortran format codes to print a character data and
numeric data.
for e.g.

n=indgen(4)
a=['earth', 'air','fire','water']
b=['solid','gas', 'heat', liquid']
then,

print,n,a,format='(i2,a5)'

i got

0 1
2 3
% Type conversion error: Unable to convert given STRING to Long64.
% Detected at: $MAIN$
0air
% Type conversion error: Unable to convert given STRING to Long64.
% Detected at: $MAIN$
0water


but then,

print,a,b,format='(a5,a7)'

i got the output

earth solid
air gas
fire heat
water liquid


What am I missing? I would be very glad if someone to help me.

Thank you very much.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: declare variables
Next Topic: Re: Silent errors in run-time

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:42:36 PDT 2025

Total time taken to generate the page: 0.00550 seconds