Sponsored Content
Full Discussion: printing arrays
Top Forums UNIX for Dummies Questions & Answers printing arrays Post 3678 by morkfard on Monday 9th of July 2001 02:49:51 PM
Old 07-09-2001
Question printing arrays

Suppose I assign these variables:
n=5
row=n
let col=n/2
val=17
let table$row[$col]=val

I want to print the last variable. How do I do that? I have tried:
echo ${table$row[$col]}
This is the error message:
ksh: ${table$row[$col]}: bad substitution
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Printing Problems in unix ... ( Bar-cdoe - Ip Printing)

Hi guys ... i need ur help with some printing problem in unix ... first prob. : i wanna print from my NCR unix to an Win NT , Ip based printing server ( HP JetDirect ) . My issue , is it possible to print directly to an Ip address from unix ? How do i make it work to get any results ?... (3 Replies)
Discussion started by: QuickSilver
3 Replies

2. Shell Programming and Scripting

Arrays

Dear all, How can i unset arrays. I mean all the subscripts including the array after using them. Could you direct me to some links of array memory handling in the korn shell. Thanks (2 Replies)
Discussion started by: earlysame55
2 Replies

3. Shell Programming and Scripting

arrays not printing properly in bash

hi guys, i wrote this script and it takes some fields from a file and puts it into three different arrays. The first array works just fine but when I try to use the second array (ARRAY1) all i get is a blank value on the screen.. this works fine..i get ARRAY value on the screen just fine ... (1 Reply)
Discussion started by: npatwardhan
1 Replies

4. Web Development

PHP arrays in arrays

PHP question... I have an SQL query that's pulled back user IDs as a set of columns. Rather than IDs, I want to use their names. So I have an array of columns $col with values 1,7,3,12 etc and I've got an array $person with values "Fred", "Bert", "Tom" etc So what I want to do is display the... (3 Replies)
Discussion started by: JerryHone
3 Replies

5. Programming

question about int arrays and file pointer arrays

if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Discussion started by: omega666
1 Replies

6. Windows & DOS: Issues & Discussions

Linux to Windows Printing: PDF starts printing from middle of page.

We are using Red Hat. We have a issue like this: We want to print from Linux, to a printer attached to a Windows machine. What we want to print is a PDF. It prints, but the printing starts from the middle of the page. In the report, there is no space at the top but still printing starts from the... (5 Replies)
Discussion started by: rohan69
5 Replies

7. UNIX for Dummies Questions & Answers

Sco Unix printing : jobs hangs in queue - printing via lp versus hpnpf

Hi, We have a Unix 3.2v5.0.5. I installed a printer via scoadmin, HP network printer manager with network peripheral name (hostname and ipadres are in /etc/hosts). This is the configuration file : Code: root@sco1 # cat configurationBanner: on:AlwaysContent types: simpleDevice:... (0 Replies)
Discussion started by: haezeban
0 Replies

8. Programming

Arrays in C++

I've noticed something interesting in C++ programming. I've always done tricky stuff with pointers and references to have functions deal with arrays. Doing exercises again out of a C++ book has shown me an easier way, I didn't even know was there. It's weird to me. When dealing with arrays, it... (4 Replies)
Discussion started by: John Tate
4 Replies

9. UNIX for Dummies Questions & Answers

Arrays

Am using bash For eg: Suppose i have a array arr=(1 2 3 4 5 6 7 8 9 10 11 12) suppose i give input 5 to a script and script should able to print values greater than or equal to 5 like below: Input: 5 output: 5,6,7,8,9,10,11,12 (7 Replies)
Discussion started by: manid
7 Replies

10. UNIX for Beginners Questions & Answers

Printing, SYSPRINTER, IP printing

Dear readers, We have a printer problem with a UNIX system. The OS is Unix IRIX 6.5 We have connected a printerto the system. If we then make a test print everything goes well . (IP printing) But if we make a print from the "orrga,i"program. Then we see all the printouts stuck within the... (3 Replies)
Discussion started by: SergevdH
3 Replies
SDL_CreateCursor(3)						 SDL API Reference					       SDL_CreateCursor(3)

NAME
SDL_CreateCursor - Creates a new mouse cursor. SYNOPSIS
#include "SDL.h" SDL_Cursor *SDL_CreateCursor(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); DESCRIPTION
Create a cursor using the specified data and mask (in MSB format). The cursor width must be a multiple of 8 bits. The cursor is created in black and white according to the following: Data / Mask Resulting pixel on screen 0 / 1 White 1 / 1 Black 0 / 0 Transparent 1 / 0 Inverted color if possible, black if not. Cursors created with this function must be freed with SDL_FreeCursor. EXAMPLE
/* Stolen from the mailing list */ /* Creates a new mouse cursor from an XPM */ /* XPM */ static const char *arrow[] = { /* width height num_colors chars_per_pixel */ " 32 32 3 1", /* colors */ "X c #000000", ". c #ffffff", " c None", /* pixels */ "X ", "XX ", "X.X ", "X..X ", "X...X ", "X....X ", "X.....X ", "X......X ", "X.......X ", "X........X ", "X.....XXXXX ", "X..X..X ", "X.X X..X ", "XX X..X ", "X X..X ", " X..X ", " X..X ", " X..X ", " XX ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "0,0" }; static SDL_Cursor *init_system_cursor(const char *image[]) { int i, row, col; Uint8 data[4*32]; Uint8 mask[4*32]; int hot_x, hot_y; i = -1; for ( row=0; row<32; ++row ) { for ( col=0; col<32; ++col ) { if ( col % 8 ) { data[i] <<= 1; mask[i] <<= 1; } else { ++i; data[i] = mask[i] = 0; } switch (image[4+row][col]) { case 'X': data[i] |= 0x01; k[i] |= 0x01; break; case '.': mask[i] |= 0x01; break; case ' ': break; } } } sscanf(image[4+row], "%d,%d", &hot_x, &hot_y); return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); } SEE ALSO
SDL_FreeCursor, SDL_SetCursor, SDL_ShowCursor SDL
Tue 11 Sep 2001, 23:01 SDL_CreateCursor(3)
All times are GMT -4. The time now is 06:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy