f



error: expected '=', ',', ';', 'asm' or '__attrib

Hi

I'm trying to compile an ADC Driver & come acrosss the following error.
I've no experience writing drivers before, and hence have no clue how
to fix it.
Hope someone out there has encountered the problem & suggesst a fix for
the same.

The Error is I get is :

qadc.c: At top level:
qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'qadc_read'
make: *** [qadc.o] Error 1
[root@localhost qadc]#

###########################################################################
ADC Driver Code
###########################################################################

#define MODULE
#define __KERNEL__
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h> /* printk */
#include <linux/fs.h> /
#include <linux/errno.h> /* error codes */

#include <linux/types.h> /* size_t */
#include <linux/proc_fs.h> /* proc file system */
#include <linux/fcntl.h>
#include <asm/system.h> /* cli, flags */
#include <asm/uaccess.h> /* copy from/to user */

/*Registers to get qadc access*/
volatile unsigned short * qadcmcr = (unsigned short *)0x40190000;
volatile unsigned short * qacr0 = (unsigned short *)0x4019000a;
volatile unsigned short * qacr1 = (unsigned short *)0x4019000c;
volatile unsigned short * qacr2 = (unsigned short *)0x4019000e;
volatile unsigned short * qasr0 = (unsigned short *)0x40190010;
volatile unsigned short * qasr1 = (unsigned short *)0x40190012;
volatile unsigned short *ccw = (unsigned short *)0x40190200;
volatile unsigned short *rjurr = (unsigned short *)0x40190280;
/* Function prototypes required by qadc.c */
int qadc_open (struct inode *inode, struct file *filp);


int qadc_release (struct inode *inode, struct file *filp);
ssize_t qadc_read(struct file *filp, char *buf, size_t count, loff_t
*f_pos);
ssize_t qadc_write (struct file *filp, const char *buf, size_t count,
loff_t *f_pos);
void cleanup_module_qadc (void);

/* Structure to declare our file access functions. */
struct file_operations qadc_fops =
{
open: qadc_open,
read: qadc_read,
write: qadc_write,
release: qadc_release
};

/* Global driver variables. */
int qadc_major = 80; /* major number */
unsigned short values[64]; /* data buffer */
int init_module_qadc(void)
{
int cntr; //counter for loop;
int result;

*qadcmcr= 0x40; //QADC operates normally
*qacr0 = 0x7f; //QCLK, disable extern mux, set the trigger assignments
*qacr1 = 0x1100; //disable interrupts, select operate mode
*qacr2 = 0x11; //disable queue 2
*qasr0 = 0;
for(cntr=0;cntr<64;cntr++)
{
rjurr[cntr]=0;
}
for(cntr=0;cntr<64;cntr++)
{
ccw[cntr] = cntr;
}
/* Register the device. */
result = register_chrdev(qadc_major, "qadc", &qadc_fops);
if (result < 0)
{
printk("<1>QADC: couldnt obtain major number %d\n",qadc_major);
return result;
}

printk("QADC driver is installed\n");

return 0;
}
/* Unload the module. */
void cleanup_module_qadc(void)
{
unregister_chrdev (qadc_major, "qadc");

}
/* Open the device file. */
int qadc_open(struct inode *inode, struct file *filp)
{
MOD_INC_USE_COUNT;
//printk("Executing qadc_open\n");
return 0;
}
/* Close the device file. */
int qadc_release(struct inode *inode, struct file *filp)
{
MOD_DEC_USE_COUNT;
//printk("Executing qadc_release\n");

return 0;
}

ssize_t qadc_read(struct file *filp, char *buf, size_t count, loff_t
*f_pos)
{
int cntr=0, adcntr, val;
*qacr1=0x1100; // Activate software triggered continous-scan mode
printk("Executing qadc_read");
while(cntr<8) //read only the 8 first channel
{
printk("Starting convertion");
if((*qasr1>>8) > 7) // When the queue is full, read it to RAM
{
printk("Data in queue");
*qacr1=0; // Deactivate software triggered continous-scan mode
for(adcntr=0;adcntr<8;adcntr++)
{
values[cntr++] = rjurr[adcntr]; // Read a value off the queue and
increment }
}
}


val = (int) values[0];
*qacr1 = 0;
/* Move data to the user space */
if(copy_to_user (buf, &val, 4))
return -EFAULT;
*f_pos++;
return 1;
}
/* Write to the file. */
ssize_t qadc_write(struct file *filp, const char *buf, size_t count,
loff_t *fpos)
{
//QADC is read only, this funciton can be removed
return 1;
}

########################################################################################################################
Cheers

krish

0
12/30/2006 9:22:11 AM
comp.arch.embedded 20047 articles. 0 followers. Post Follow

13 Replies
2816 Views

Similar Articles

[PageSpeed] 41

techie.embedded@gmail.com wrote:
> Hi
> 
> I'm trying to compile an ADC Driver & come acrosss the following error.
> I've no experience writing drivers before, and hence have no clue how
> to fix it.
> Hope someone out there has encountered the problem & suggesst a fix for
> the same.
> 
> The Error is I get is :
> 
> qadc.c: At top level:
> qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
> before 'qadc_read'
> make: *** [qadc.o] Error 1
> [root@localhost qadc]#
> ########################################################################################################################
> Cheers
> 
> krish
> 

Are you sure, its a driver issue? None of the "Expected Error" show
that... It should have been a driver issue if it compiled and still
couldn't drive your system.

What about C programming experience??
0
hs.chauhan (114)
12/30/2006 9:47:39 AM
Robert Adsett <subscriptions@aeolusdevelopment.com> wrote:
> In article <1167470530.933569.143970@v33g2000cwv.googlegroups.com>, 
> techie.embedded@gmail.com says...
>> Hi
>> 
>> I'm trying to compile an ADC Driver & come acrosss the following error.
>> I've no experience writing drivers before, and hence have no clue how
>> to fix it.
>> Hope someone out there has encountered the problem & suggesst a fix for
>> the same.
>> 
>> The Error is I get is :
>> 
>> qadc.c: At top level:
>> qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
>> before 'qadc_read'
>> make: *** [qadc.o] Error 1
>> [root@localhost qadc]#
> <snip>
>> /* Structure to declare our file access functions. */
>> struct file_operations qadc_fops =
>> {
>> open: qadc_open,
>> read: qadc_read,
>> write: qadc_write,
>> release: qadc_release
>> };

> Well, the above isn't valid C so I'd start there.

It was some time back but now it's changed.

---
******************************************************************
*  KSI@home    KOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
******************************************************************

-- 
Posted via a free Usenet account from http://www.teranews.com

0
ksi (21)
12/30/2006 10:57:24 PM
In article <1167470530.933569.143970@v33g2000cwv.googlegroups.com>, 
techie.embedded@gmail.com says...
> Hi
> 
> I'm trying to compile an ADC Driver & come acrosss the following error.
> I've no experience writing drivers before, and hence have no clue how
> to fix it.
> Hope someone out there has encountered the problem & suggesst a fix for
> the same.
> 
> The Error is I get is :
> 
> qadc.c: At top level:
> qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
> before 'qadc_read'
> make: *** [qadc.o] Error 1
> [root@localhost qadc]#
<snip>
> /* Structure to declare our file access functions. */
> struct file_operations qadc_fops =
> {
> open: qadc_open,
> read: qadc_read,
> write: qadc_write,
> release: qadc_release
> };

Well, the above isn't valid C so I'd start there.

Robert

-- 
Posted via a free Usenet account from http://www.teranews.com

0
12/30/2006 11:05:21 PM
In article <4596eed3$0$18582$88260bb3@free.teranews.com>, Sergey 
Kubushin says...
> Robert Adsett <subscriptions@aeolusdevelopment.com> wrote:
> > In article <1167470530.933569.143970@v33g2000cwv.googlegroups.com>, 
> > techie.embedded@gmail.com says...
> >> Hi
> >> 
> >> I'm trying to compile an ADC Driver & come acrosss the following error.
> >> I've no experience writing drivers before, and hence have no clue how
> >> to fix it.
> >> Hope someone out there has encountered the problem & suggesst a fix for
> >> the same.
> >> 
> >> The Error is I get is :
> >> 
> >> qadc.c: At top level:
> >> qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
> >> before 'qadc_read'
> >> make: *** [qadc.o] Error 1
> >> [root@localhost qadc]#
> > <snip>
> >> /* Structure to declare our file access functions. */
> >> struct file_operations qadc_fops =
> >> {
> >> open: qadc_open,
> >> read: qadc_read,
> >> write: qadc_write,
> >> release: qadc_release
> >> };
> 
> > Well, the above isn't valid C so I'd start there.
> 
> It was some time back but now it's changed.

As of?  AFAIR it isn't part of C89/90 and the more recent changes are 
not generally available.  It's certainly the line the compiler is 
complaining about. 

Robert

-- 
Posted via a free Usenet account from http://www.teranews.com

0
12/31/2006 12:41:20 AM
In article <MPG.2000d13782aaec369896b1@free.teranews.com>, Robert Adsett 
says...
> In article <4596eed3$0$18582$88260bb3@free.teranews.com>, Sergey 
> Kubushin says...
> > Robert Adsett <subscriptions@aeolusdevelopment.com> wrote:
> > > In article <1167470530.933569.143970@v33g2000cwv.googlegroups.com>, 
> > > techie.embedded@gmail.com says...
> > >> Hi
> > >> 
> > >> I'm trying to compile an ADC Driver & come acrosss the following error.
> > >> I've no experience writing drivers before, and hence have no clue how
> > >> to fix it.
> > >> Hope someone out there has encountered the problem & suggesst a fix for
> > >> the same.
> > >> 
> > >> The Error is I get is :
> > >> 
> > >> qadc.c: At top level:
> > >> qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
> > >> before 'qadc_read'
> > >> make: *** [qadc.o] Error 1
> > >> [root@localhost qadc]#
> > > <snip>
> > >> /* Structure to declare our file access functions. */
> > >> struct file_operations qadc_fops =
> > >> {
> > >> open: qadc_open,
> > >> read: qadc_read,
> > >> write: qadc_write,
> > >> release: qadc_release
> > >> };
> > 
> > > Well, the above isn't valid C so I'd start there.
> > 
> > It was some time back but now it's changed.
> 
> As of?  AFAIR it isn't part of C89/90 and the more recent changes are 
> not generally available.  It's certainly the line the compiler is 
> complaining about. 

I did a little checking, the only reference Ive found to member 
initialization in C  uses the following syntax

struct point location = { .y = 13, .x = 10 };

No mention of the syntax above.  Even that is only present in C99 and so 
far from widely available.  

Do you have a reference for the validity of the syntax in the original 
post?

Robert

-- 
Posted via a free Usenet account from http://www.teranews.com

0
12/31/2006 12:49:32 AM
Sergey Kubushin wrote:
> Robert Adsett <subscriptions@aeolusdevelopment.com> wrote:
>> In article <1167470530.933569.143970@v33g2000cwv.googlegroups.com>, 
>> techie.embedded@gmail.com says...
>>> Hi
>>>
>>> I'm trying to compile an ADC Driver & come acrosss the following error.
>>> I've no experience writing drivers before, and hence have no clue how
>>> to fix it.
>>> Hope someone out there has encountered the problem & suggesst a fix for
>>> the same.
>>>
>>> The Error is I get is :
>>>
>>> qadc.c: At top level:
>>> qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
>>> before 'qadc_read'
>>> make: *** [qadc.o] Error 1
>>> [root@localhost qadc]#
>> <snip>
>>> /* Structure to declare our file access functions. */
>>> struct file_operations qadc_fops =
>>> {
>>> open: qadc_open,
>>> read: qadc_read,
>>> write: qadc_write,
>>> release: qadc_release
>>> };
> 
>> Well, the above isn't valid C so I'd start there.
> 
> It was some time back but now it's changed.
> 
> ---
> ******************************************************************
> *  KSI@home    KOI8 Net  < >  The impossible we do immediately.  *
> *  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
> ******************************************************************
> 
The syntax was an extension in gcc to simplify Linux device drivers. If 
you are not using gcc the compiler doesn't recognize it. It has been 
years since I have written a Linux device driver so the construct could 
  have changed an be no longer supported. (I know they made some changed 
in device drivers in the newer kernels.)
0
dennis4312 (19)
12/31/2006 4:11:01 AM
Robert Adsett <subscriptions@aeolusdevelopment.com> wrote:
> In article <MPG.2000d13782aaec369896b1@free.teranews.com>, Robert Adsett 
> says...

[dd]

>> > > <snip>
>> > >> /* Structure to declare our file access functions. */
>> > >> struct file_operations qadc_fops =
>> > >> {
>> > >> open: qadc_open,
>> > >> read: qadc_read,
>> > >> write: qadc_write,
>> > >> release: qadc_release
>> > >> };
>> > 
>> > > Well, the above isn't valid C so I'd start there.
>> > 
>> > It was some time back but now it's changed.
>> 
>> As of?  AFAIR it isn't part of C89/90 and the more recent changes are 
>> not generally available.  It's certainly the line the compiler is 
>> complaining about. 

> I did a little checking, the only reference Ive found to member 
> initialization in C  uses the following syntax

> struct point location = { .y = 13, .x = 10 };

> No mention of the syntax above.  Even that is only present in C99 and so 
> far from widely available.  

> Do you have a reference for the validity of the syntax in the original 
> post?

Look into any 2.4.xx Linux kernel source, e.g. in drivers/mtd/nand look for
nand_base.c if I still remember those older kernels. Or nand_ids.c. There is
a lot of this type structure initializations in there. Then everything
changed to { .member = value } style that is, IMHO, not any better than that
old GCC { member: value } style.

This was _GCC_ extension though you probably won't find it in C/C++
standards. Nowadays this style is considered obsolete and newer GCC uses C99
notation.

---
******************************************************************
*  KSI@home    KOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
******************************************************************

-- 
Posted via a free Usenet account from http://www.teranews.com

0
ksi (21)
12/31/2006 4:11:58 AM
In article <4597388e$0$18638$88260bb3@free.teranews.com>, Sergey 
Kubushin says...
> Robert Adsett <subscriptions@aeolusdevelopment.com> wrote:
> > In article <MPG.2000d13782aaec369896b1@free.teranews.com>, Robert Adsett 
> > says...
> 
> [dd]
> 
> >> > > <snip>
> >> > >> /* Structure to declare our file access functions. */
> >> > >> struct file_operations qadc_fops =
> >> > >> {
> >> > >> open: qadc_open,
> >> > >> read: qadc_read,
> >> > >> write: qadc_write,
> >> > >> release: qadc_release
> >> > >> };
> >> > 
> >> > > Well, the above isn't valid C so I'd start there.
> >> > 
> >> > It was some time back but now it's changed.
> >> 
> >> As of?  AFAIR it isn't part of C89/90 and the more recent changes are 
> >> not generally available.  It's certainly the line the compiler is 
> >> complaining about. 
<snip>
> This was _GCC_ extension though you probably won't find it in C/C++
> standards. Nowadays this style is considered obsolete and newer GCC uses C99
> notation.

So not valid C, just an obsolete GCC extension. 

Robert

-- 
Posted via a free Usenet account from http://www.teranews.com

0
12/31/2006 5:21:24 AM
On 2006-12-31, Dennis <dennis@nowhere.net> wrote:

>>>> /* Structure to declare our file access functions. */
>>>> struct file_operations qadc_fops =
>>>> {
>>>> open: qadc_open,
>>>> read: qadc_read,
>>>> write: qadc_write,
>>>> release: qadc_release
>>>> };
>> 
>>> Well, the above isn't valid C so I'd start there.
>> 
>> It was some time back but now it's changed.
>
> The syntax was an extension in gcc to simplify Linux device
> drivers. If you are not using gcc the compiler doesn't
> recognize it. It has been years since I have written a Linux
> device driver so the construct could have changed an be no
> longer supported. (I know they made some changed in device
> drivers in the newer kernels.)

I was just using that the other day, so I know it's still
supported in gcc 3.4.  I don't know if it's been deprecated or
removed in 4.1.

-- 
Grant Edwards                   grante             Yow!  I'm wet! I'm wild!
                                  at               
                               visi.com            
0
grante (5416)
12/31/2006 4:40:04 PM
Hello all

I'm using gcc-2.95 ( the m68k toolchain )....

So, what is the conslusion of the discussion ???? The Structure
declaration is not supported by gcc-2.95 ???

thanks

krish
Grant Edwards wrote:
> On 2006-12-31, Dennis <dennis@nowhere.net> wrote:
>
> >>>> /* Structure to declare our file access functions. */
> >>>> struct file_operations qadc_fops =
> >>>> {
> >>>> open: qadc_open,
> >>>> read: qadc_read,
> >>>> write: qadc_write,
> >>>> release: qadc_release
> >>>> };
> >>
> >>> Well, the above isn't valid C so I'd start there.
> >>
> >> It was some time back but now it's changed.
> >
> > The syntax was an extension in gcc to simplify Linux device
> > drivers. If you are not using gcc the compiler doesn't
> > recognize it. It has been years since I have written a Linux
> > device driver so the construct could have changed an be no
> > longer supported. (I know they made some changed in device
> > drivers in the newer kernels.)
>
> I was just using that the other day, so I know it's still
> supported in gcc 3.4.  I don't know if it's been deprecated or
> removed in 4.1.
>
> --
> Grant Edwards                   grante             Yow!  I'm wet! I'm wild!
>                                   at
>                                visi.com

0
1/1/2007 8:40:54 AM
krish wrote:

> I'm using gcc-2.95 ( the m68k toolchain )....
> 
> So, what is the conslusion of the discussion ???? The Structure
> declaration is not supported by gcc-2.95 ???

Not quite. It would be supported, but only if your GCC was run with 
extensions enabled.  In other words: lose that -ansi switch.

[and please consider bottom-posting and snipping quoted material...]

0
HBBroeker (925)
1/1/2007 2:38:28 PM
Hans-Bernhard Br�ker wrote:
> krish wrote:
> 
>> I'm using gcc-2.95 ( the m68k toolchain )....
>>
>> So, what is the conslusion of the discussion ???? The Structure
>> declaration is not supported by gcc-2.95 ???
> 
> Not quite. It would be supported, but only if your GCC was run with
> extensions enabled.  In other words: lose that -ansi switch.

No, don't.  Revise the code to be standard compatible.

> 
> [and please consider bottom-posting and snipping quoted material...]

This I can heartily endorse.

-- 
Merry Christmas, Happy Hanukah, Happy New Year
        Joyeux Noel, Bonne Annee.
Chuck F (cbfalconer at maineline dot net)
     <http://cbfalconer.home.att.net>


0
cbfalconer (19194)
1/1/2007 3:45:50 PM
Hans-Bernhard Br=F6ker wrote:

>
>>>>>> Not quite. It would be supported, but only if your GCC was run with
>>>>>> extensions enabled.  In other words: lose that -ansi switch.
>

Could you please clarify on how exactly I do that ???

That is, what are the extensions to be added or removed & where ????

Cheers

krish

0
1/2/2007 5:01:55 AM
Reply:

Similar Artilces:

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y" tells you whether x and y actually refer to the same object. In the case of singletons like None (there's only one None object), it's better to use "is". "ElChino" <elchino@cnn.cn>: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: Do the following: take two $10 bills. Hold one bill in the left hand, hold the other bill in the right hand. Now, the bill in the left hand "is not" the bill in the right hand. However, the bill in the left hand "==" the bill in the right hand. > Without any context, which one should be preferred? > IMHO, the latter is more readable. In almost all cases, both tests would result in the same behavior. However, the "is not" test is conceptually the correct one since you want...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
Hi, there. =20 I'm just curious if it ever dawned on anybody how to abbreviate this line : if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

logical to 'on' / 'off'
Hi, is there a function implemented doing this conversion? my Problem is, that I want to use the following code: set(handles.edit_curr_trq_sl,'Enable',get(hObject,'Value')) where get(hObject,'Value') gives the state of a checkbox thank you! function [str]=tf2oo(logic) switch logic case 0 str='off'; case 1 str='on'; end%switch end%function tf2oo() while i do not know a built in function, I use my own:) meisterbartsch wrote: > > > function [str]=tf2oo(logic) > switch logic > case 0 > str='off'; &g...

Override 'and' and 'or'
Is it possible to override 'and' and/or 'or'? I cannot find a special method for it... __and__ and __rand__ and __or__ and __ror__ are for binary manipulation... any proposals? Have marvelous sunday, Marco Dekker <m.aschwanden@gmail.com> wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? If you want to customize the truth value testing you have to implement __nonzero__ " __nonzero__( self) Call...

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

Does '!=' equivelent to 'is not'
I'm a bit confusing about whether "is not" equivelent to "!=" if a != b: ... if a is not b: ... What's the difference between "is not" and "!=" or they are the same thing? pirata wrote: > I'm a bit confusing about whether "is not" equivelent to "!=" > > if a != b: > ... > > if a is not b: > ... > > > What's the difference between "is not" and "!=" or they are the same thing? No, they are not the same thing. == and != test to see if the *value* of two variables are the same. Like so: >>> a = 'hello world' >>> b = 'hello world' >>> a == b True a and b both have the value of 'hello world', so they are equal is and is not, however, do not test for value equivalence, they test for object identity. In other words, they test to see if the object the two variables reference are the same object in memory, like so: >>> a is b False a and b are assigned to two different objects that happen to have the same value, but nevertheless there are two separate 'hello world' objects in memory, and therefore you cannot say that a *is* b Now look at this: >>> c = d = 'hello world' >>> c == d True >>> c is d True In this case, they are again the same value, but now the is test also shows that they are the same *object* as well, because...

Difference between 'is' and '=='
Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? Thanks alot~ mwql: >Hey guys, this maybe a stupid question, but I can't seem to find the >result anywhere online. When is the right time to use 'is' and when >should we use '=='? http://docs.python.org/ref/comparisons.html -- Ren� Pijlman mwql wrote: > Hey guys, this maybe a stupid question, but I can't seem to find the > result anywhere online. When is the right time to ...

'[OFF]' as in 'offensive'???
Hi, given that 'off-topicness' is indicated as '[OT]' and taking a look at those postings that started the threads indicated as '[OFF]' (which may both be seen as being somewhat offensive) may lead to the conclusion that '[OFF]' stands for offensiveness. I don't think that this is the intended meaning so what actually *does* '[OFF]' mean? I never came across that abbreviation before (although I have been around on the USENET for quite some time) but maybe it is worth knowing? Josef 'Jupp' Schugt NOTE: mails >100 KiB are ignored -- German edition of comp.lang.ruby FAQ - http://oss.erdfunkstelle.de/ruby/ Aurox Linux - http://qurl.net/7q | http://qurl.net/7r - Firefox Thunderbird - http://qurl.net/7s | http://qurl.net/7t - Liferea Enigmail - http://qurl.net/7u | http://qurl.net/7v - GnuPG [Josef 'Jupp' Schugt <jupp@gmx.de>, 2004-12-10 23.20 CET] > I don't think that this is the intended meaning so what actually *does* > '[OFF]' mean? Off-topic. ...

'a'..'z'
Is it possible to achieve something like this? switch (mystring.charAt(0)) { case 'a'..'z': // do something break; } "cruster" <cruster@gmail.com> wrote in message news:1151319731.988814.326200@m73g2000cwd.googlegroups.com... > Is it possible to achieve something like this? > > switch (mystring.charAt(0)) { > case 'a'..'z': > // do something > break; > } > There are times when an if statement may be more appropriate ;) Sorry - java is not VB :) -- LTP :) cruster schreef: > Is it possible to achieve somethi...

'!' vs. '.'
Is there an advantage to using the '!' notation to represent form/ control relationships? (eg. Me!text1 vs Me.text1) I am currently using the '.' notation exclusively (for code completion in the VB Editor), but much of the high-quality code that I've seen (in Duane Hookom's Query-by-Form db, for example) uses the other. Here's one opinion for you: http://doc.advisor.com/doc/05352 robert.waters wrote: >Is there an advantage to using the '!' notation to represent form/ >control relationships? (eg. Me!text1 vs Me.text1) > >I am currently using the '.' notation exclusively (for code completion >in the VB Editor), but much of the high-quality code that I've seen >(in Duane Hookom's Query-by-Form db, for example) uses the other. -- HTH - RuralGuy (RG for short) acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200704/1 Here's my $0.02 worth on this. I tend to copy the notation style and naming conventions that I see being used in the Help files. That would be Me![text1] for a control on a form. I am of the belief that this notation explicitly refers to a control itself rather than a field in the form's recordset. Here's an example: I have a parts inventory app that uses a "Line" code, which is usually a 3-character abbreviation for a brand name, and is the na...

difference between ',' and 'a,'
Small question. In gforth is there a difference between the words ',' and 'a,'? I'm thinking not, so perhaps another question, why have both ',' and 'a,'? Thanks Should be the same, in gforth: see , : , here cell allot ! ; ok see a, : , here cell allot ! ; ok On Friday, January 9, 2015 at 5:46:04 AM UTC-8, beeflo wrote: > Small question. In gforth is there a difference between the words ',' and 'a,'? > > I'm thinking not, so perhaps another question, why have both ',' and 'a,'? > > Thanks beeflo <beeflobill@gmail.com> writes: >Small question. In gforth is there a difference between the words ',' and 'a,'? > >I'm thinking not, so perhaps another question, why have both ',' and 'a,'? In Gforth itself, there is no difference. In Gforth's cross compiler, "a," is there for addresses, and "," is there for other cells; addresses can then be relocated when loading the image. - anton -- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: http://www.forth200x.org/forth200x.html EuroForth 2014: http://www.euroforth.org/ef14/ ...

We Are Selling The Nextel I930 For Just $130usd'''''''''''
Dear Customer We have all brands of Mobile Phones,Ipods,Sidekicks,Nextel phone,Laptops for sell at cheap an affordable prices, they ranges from Nokia/Samsung/LG/Son Ericsson/Motorola/Alcatel/panasonic With Bluetooth, al Brands and Models of Nextel Phones, we want you to get bac to us with your quote so that we can begin a good busines relationship. Note they are all Brand New T2 Euro specs unlocked, no operator logo, come in thei original sealed box, With 1 year international warrant from the manufacturer, English & Spanish manual, Finlan made We want to assure you that you will never r...

Parse error: parse error, expecting `','' or `';''
I'm getting the following error Parse error: parse error, expecting `','' or `';'' in /home/notarywe/public_html/php/update2.php on line 108 Here is line 108 <input type="text" name="ud_first" value="<? echo "$first" size="20"?>"></td> Any help would be appreciated. On 3-Aug-2003, "entoone" <entoone@pacbell.net> wrote: > I'm getting the following error Parse error: parse error, expecting `','' > or > `';'' in /home/notarywe/public_h...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ? #2
Igor, There are many ways to make it more concise, however the parsimony is likely to be achieved at the expense of clarity. For instance, the expressions length ( input (mm||dd||yy, $10.) ) > 2 length ( compress(mm||dd||yy, ' .') ) > 2 and like might be somewhat shorter than the original, but they will execute slower, and their intent is far less eminent. Since it appears that you are trying to validate the components of a date, maybe it is not a worthless idea to try the date informat conforming to the mask you are testing. Say if all the pieces are 2-digit, the expression input (mm||dd||yy, ?? mmddyy6.) will return a missing value for the case you are testing and also if any irregularities in the input value that prevent it from being interpreted as a valid date should be found. And if you want a note in the log to alert you about it, leave one of the question marks off. Kind regards, ================= Paul M. Dorfman Jacksonville, FL ================= >From: Igor Kurbeko <ikurbeko@ATHEROGENICS.COM> >Reply-To: Igor Kurbeko <ikurbeko@ATHEROGENICS.COM> >To: SAS-L@LISTSERV.UGA.EDU >Subject: if str_mo not in ('','.') and str_da not in ('','.') and str_yy > not in ('','.') Any shorter ? >Date: Wed, 22 Oct 2003 17:13:37 -0400 > >Hi, there. > > > >I'm just curious if it ever dawned on anybody how to abbreviate this >line : > >if ...

We Are Selling The Samsung D500 For Just $189usd'''''''''
Dear Customer We have all brands of Mobile Phones,Ipods,Sidekicks,Nextel phone,Laptops for sell at cheap an affordable prices, they ranges from Nokia/Samsung/LG/Son Ericsson/Motorola/Alcatel/panasonic With Bluetooth, al Brands and Models of Nextel Phones, we want you to get bac to us with your quote so that we can begin a good busines relationship. Note they are all Brand New T2 Euro specs unlocked, no operator logo, come in thei original sealed box, With 1 year international warrant from the manufacturer, English & Spanish manual, Finlan made We want to assure you that you will never r...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_ yy not in ('','.') Any shorter ? #3
> From: Igor Kurbeko [mailto:ikurbeko@ATHEROGENICS.COM] > I'm just curious if it ever dawned on anybody > how to abbreviate this line : > > if str_mo not in ('','.') > and str_da not in ('','.') > and str_yy not in ('','.') %*in autoexec:; %Let Blank = Blank; %Let Invalid = Invalid; %*in aFormat; PROC Format; value $StrValu %*somevalues = 'ok'; '','.' = "&Blank." %* other = "&Invalid."; ; %*in Program; if put(Str_...

Re: if str_mo not in ('','.') and str_da not in ('','.') and str_ yy not in ('','.') Any shorter ? #4
Igor, Without robust error checking: %macro check ( vars , values , op = in /* not in */, con = and /* or */ ) ; %local i w ; %let i = 1 ; %let w = %scan(&vars,&i) ; %do %while ( %length ( &w ) > 0 ) ; %if &i > 1 %then &con ; &w &op &values %let i = %eval ( &i + 1 ) ; %let w = %scan(&vars,&i) ; %end ; %mend check ; option mprint ; data w ; retain x y z "a" r " " s t "a" a b 99 c . ; if %check( x y z , ('','.'), op = not in ) then put &qu...

How is there an 'error' with 'no message'
I have a form with many fields, each of which has their separate record sources in a split db. Today, several users throughout the afternoon encountered the following message when accessing various dropdowns on the form: "Error (-1517). There is no message for this error." Three questions: 1. Has anyone encountered this error before? 2. If so, how was it overcome? 3. How can MS produce an error message that states : "There is no message for this error"? It would seem to me that if MS has assigned a number to an error, they must know that it can happen. If they k...

Removing the letters 't' 'i' 'x' and 'y'
Im having trouble with figuring out how to write a function which will remove the letters 't' 'i' 'x' and 'y' from any input string in matlab. for example modstr(pixy) should result in ans = 'p' or modstr(picture) should result in ans = 'pcure' if anyone could offer any help or hints i would really appreciate it. Thank You >> modstr=@(s) s(~ismember(s,'tixy')) modstr = @(s)s(~ismember(s,'tixy')) >> modstr('picture') ans = pcure % Bruno ...

Avoid 'int', 'long' and 'short'...
.... #include <cstdint> instead! /Flibble On 26/06/2015 20:39, Mr Flibble wrote: > ... #include <cstdint> instead! > > /Flibble you mean using int16_t? why is that? int is the fastest integer so why would i use something else? On 26/06/2015 21:31, JiiPee wrote: > On 26/06/2015 20:39, Mr Flibble wrote: >> ... #include <cstdint> instead! >> >> /Flibble > > you mean using int16_t? why is that? > int is the fastest integer so why would i use something else? Because 'int' is both unsafe and non-portable. If yo...

Web resources about - error: expected '=', ',', ';', 'asm' or '__attrib - comp.arch.embedded

Resources last updated: 3/17/2016 7:38:10 AM