Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28456 Discussions

seeing the character in an integer vaiable

steve_konarski
Beginner
802 Views

I have   integer variables which represent ASCII characters for example for example 538976304 is a zero  ( in hex it is "20202030" )  . In the watch list in Visual fortran 2008 if you put a ",s" after the variable for example i,s you got the  variable character in this case "0"   or  if you put  i,x you got the hex value. "20202030", however IF2013  gives an  syntax error ?. Similarly if I() was an array putting I(1:10),s gave the first 10 values of I in character form instead of the 5******** numbers

 

Have you a solution to this problem

 

 Regards Steve

0 Kudos
13 Replies
Steven_L_Intel1
Employee
802 Views

I was a bit confused by your problem statement - you start out talking about VS2008 and then say "IF2013". I did some tests and found that even with the latest Intel Fortran compiler (14.0, 2013 SP1), VS2008 and VS2010 both still support the ,s and ,x syntax, though I was unaware that it existed. I did see that VS2012 doesn't support that syntax with Fortran. All of them support the a(1:10) syntax, but again VS2012 doesn't support adding ,s or ,x. I can't get any of the VS versions to ignore the array section syntax.

My guess is that the developers for the VS2012 support were unaware of this comma syntax and didn't implement it. I will ask them to do that. Can you provide more details on the array issue?

0 Kudos
steve_konarski
Beginner
802 Views

Hi Steve the ,s and ,x syntax are used to show characters and hex notation and worked in VS2008 but they now do not in IF2013 (fortran) on VS 2012 (vis studio). similarly for arrays,  VS 2008 supported a(1:10),s and a(1:10),x - where A is an integer  array   .  a(1:10) expanded gave a list of decimal numbers of the characters  538936304 etc , a(1:10)x would give a list of hex numbers '20202030' etc and a(1;10),s would give the characters "0" etc

Presumeably if it is possible to have the single variable with ,s and ,x then the arrays would also work

steve

 

0 Kudos
Steven_L_Intel1
Employee
802 Views

Ok - so as I said the difference is between VS2008 and VS2012 in that the ,x and ,s syntax is not supported under VS2012. The compiler version has little to do with it other than you needed the 2013 version to use VS2012 at all. I still don't see the behavior in the last part of your original post where you implied that the array section in the watch was ignored and you got the whole array.

0 Kudos
nvaneck
New Contributor I
802 Views

Nice to know this! I wish I'd known earlier.  I find ,x works with long character variables to see hexadecimal contents. Only way before was to use memory windows, which is awkward, since turning on hexadecimal desplay doesn't work for these.

0 Kudos
netphilou31
New Contributor II
802 Views

This feature was already available on Compaq Visual Fortran 6 ! (and it works also with VS2010 Shell)

0 Kudos
Steven_L_Intel1
Employee
802 Views

Escalated as DPD200247916.

0 Kudos
steve_konarski
Beginner
802 Views

Hi Steve what do you mean by DPD200247916

I think I confused you about arrays - In the program I have the array IJCHR and here is the effect in MSV2008 of expanding the array  and then using ,s and then ,x notation in the watch window it gives

 

-  ijchr(1:6) {...} INTEGER(4)
  ijchr(1) 538968138 INTEGER(4)
  ijchr(2) 538968161 INTEGER(4)
  ijchr(3) 538968163 INTEGER(4)
  ijchr(4) 538968171 INTEGER(4)
  ijchr(5) 538968165 INTEGER(4)
  ijchr(6) 538968180 INTEGER(4)


Using ,s

-  ijchr(1:6),s {...} INTEGER(4)
  ijchr(1) 'J INTEGER(4)
  ijchr(2) 'a INTEGER(4)
  ijchr(3) 'c INTEGER(4)
  ijchr(4) 'k INTEGER(4)
  ijchr(5) 'e INTEGER(4)
  ijchr(6) 't INTEGER(4)

using ,x


-  ijchr(1:6),x {...} INTEGER(4)
  ijchr(1) #2020004A INTEGER(4)
  ijchr(2) #20200061 INTEGER(4)
  ijchr(3) #20200063 INTEGER(4)
  ijchr(4) #2020006B INTEGER(4)
  ijchr(5) #20200065 INTEGER(4)
  ijchr(6) #20200074 INTEGER(4)

Note: my program caters for unicode integers , thats why the first character in hex is 2020004A instead of 2020204A  etc. 

 

So now you say this facility is not supported in VS2012, which is bad news for me

 

 Steve

 

0 Kudos
Steven_L_Intel1
Employee
802 Views

The facility is not currently supported for Fortran in VS2012. I have asked that it be added. The internal tracking ID for this request is DPD200247916.

0 Kudos
steve_konarski
Beginner
802 Views

Thnaks Steve

0 Kudos
Steven_L_Intel1
Employee
802 Views

The developers have restored the formatting option for a release in the second half of this year.

0 Kudos
steve_konarski
Beginner
802 Views

Thanks Steve

 

I presume this will be a "HOTFIX" for VS 2012

 

regards Steve

0 Kudos
Steven_L_Intel1
Employee
802 Views

It's a change to the Fortran Expression Evaluator, so when you install the new version, and its VS2012 integration, you'll get the fix.

0 Kudos
JohnNichols
Valued Contributor III
802 Views

Steve Lionel (Intel) wrote:

It's a change to the Fortran Expression Evaluator, so when you install the new version, and its VS2012 integration, you'll get the fix.

You know Steve, my old man is a shrink, he used fix in a different context to you - thanks for reminding me of him --

JMN

0 Kudos
Reply