473,799 Members | 3,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

question from beginner

Hi, Im new on phyton programming.
On my GPRS modem with embedded Phyton 1.5.2+ version, I have to receive
a string from serial port and after send this one enclosed in an
e-mail.
All OK if the string is directly generated in the code. But it doesn't
works if I wait for this inside a 'while' loop. This is the simple
code:

global stringZVEI

while stringZVEI=='':
MOD.sleep(10)
a=SER.send(' sono nel while stringZVEI==st vuota')
stringZVEI = SER.readbyte()
a=SER.send(' stringZVEI=')
a=SER.send(stri ngZVEI)

MOD and SER are embedded class maked by third part.
From my very little debug possibility it seem that loop is executed 1

time only nevertheless stringZVEI is still empty. The line
a=SER.send(' stringZVEI=')
work correctly but

a=SER.send(stri ngZVEI)

doesn't work

Any suggestion?

Thanks
Dario.

Sep 7 '05 #1
16 2625
On 7 Sep 2005 07:14:37 -0700, "dario" <ke******@liber o.it> declaimed the
following in comp.lang.pytho n:
Hi, Im new on phyton programming.
On my GPRS modem with embedded Phyton 1.5.2+ version, I have to receive
a string from serial port and after send this one enclosed in an
e-mail.
All OK if the string is directly generated in the code. But it doesn't
works if I wait for this inside a 'while' loop. This is the simple
code:
First -- post the real code file would help -- the indentation of
the first two statements below is wrong.
global stringZVEI
This does nothing at the top level -- if only makes sense INSIDE a
"def" block, where it has the effect of saying "this variable is not
local to the function"
while stringZVEI=='':
MOD.sleep(10)
There is something wrong with

import time
time.sleep(<sec onds>)
????
a=SER.send(' sono nel while stringZVEI==st vuota')
stringZVEI = SER.readbyte()
#for debug
print "%2X " % stringZVEI
a=SER.send(' stringZVEI=')
a=SER.send(stri ngZVEI)

MOD and SER are embedded class maked by third part.
From my very little debug possibility it seem that loop is executed 1 time only nevertheless stringZVEI is still empty. The line
a=SER.send(' stringZVEI=')
work correctly but

a=SER.send(stri ngZVEI)

What does .readbyte() do if there is no data to be read? Since your
loop is based on a totally empty string, if .readbyte returns /anything/
(even a "null" byte -- 0x00) your loop will exit; and a null byte may
not be visible on the send...

-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Sep 7 '05 #2
Thanks Dennis. In effect stringZVEI doesn't remain empty after the
..read method, then the loop is executed 1 time.

How could be a 'while' loop to wait a no empty string from the serial
port?

Dario.

Dennis Lee Bieber ha scritto:
On 7 Sep 2005 07:14:37 -0700, "dario" <ke******@liber o.it> declaimed the
following in comp.lang.pytho n:
Hi, Im new on phyton programming.
On my GPRS modem with embedded Phyton 1.5.2+ version, I have to receive
a string from serial port and after send this one enclosed in an
e-mail.
All OK if the string is directly generated in the code. But it doesn't
works if I wait for this inside a 'while' loop. This is the simple
code:

First -- post the real code file would help -- the indentation of
the first two statements below is wrong.
global stringZVEI

This does nothing at the top level -- if only makes sense INSIDE a
"def" block, where it has the effect of saying "this variable is not
local to the function"
while stringZVEI=='':
MOD.sleep(10)


There is something wrong with

import time
time.sleep(<sec onds>)
????
a=SER.send(' sono nel while stringZVEI==st vuota')
stringZVEI = SER.readbyte()


#for debug
print "%2X " % stringZVEI
a=SER.send(' stringZVEI=')
a=SER.send(stri ngZVEI)

MOD and SER are embedded class maked by third part.
From my very little debug possibility it seem that loop is executed 1

time only nevertheless stringZVEI is still empty. The line
a=SER.send(' stringZVEI=')
work correctly but

a=SER.send(stri ngZVEI)

What does .readbyte() do if there is no data to be read? Since your
loop is based on a totally empty string, if .readbyte returns /anything/
(even a "null" byte -- 0x00) your loop will exit; and a null byte may
not be visible on the send...

--
> =============== =============== =============== =============== == <
> wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wu******@dm.net | Bestiaria Support Staff <
> =============== =============== =============== =============== == <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.ne tcom.com/> <


Sep 8 '05 #3
On 8 Sep 2005 09:14:15 -0700, "dario" <ke******@liber o.it> declaimed the
following in comp.lang.pytho n:
Thanks Dennis. In effect stringZVEI doesn't remain empty after the
.read method, then the loop is executed 1 time.

How could be a 'while' loop to wait a no empty string from the serial
port?

My apologies, I am having some difficulty making sense of some of
your phrases.

The first question I would have to ask is: what are the
specifications of that .readbyte() call. If it doesn't wait for a data
byte, what does it return? If it does wait for a data byte, there is NO
way to look for an "empty string".

The second question I have to ask is: .readbyte() would seem to read
only one byte at a time, is that really what you want -- one byte per
read? or do you want a "string" that ends with a <return>
-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Sep 9 '05 #4
Dennis, my english is not too good...

About first question this is the implementation of SER class (this is
freeware from the source www.telit.it):

#Telit Extensions
#
#Copyright © 2004, DAI Telecom S.p.A.
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions
#are met:
#
#Redistribution s of source code must retain the above copyright notice,

#this list of conditions and the following disclaimer.
#
#Redistribution s in binary form must reproduce the above copyright
#notice, this list of conditions and the following disclaimer in
#the documentation and/or other materials provided with the
distribution.
#
#
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS
#IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
#TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
#PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
#EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
#PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
#LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
#NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
import time
import serial

freeser = serial.Serial(' COM4', 9600, timeout=0, rtscts=1)

def send(string):
global freeser
freeser.write(s tring)
result = 1
return result

def receive(timeout ):
global freeser
sectimeout = int((timeout+5)/10)
time.sleep(sect imeout)
string = freeser.read(51 2)
return string

def read():
global freeser
string = freeser.read(51 2)
return string

def sendbyte(byte):
global freeser
string = chr(byte)
freeser.write(s tring)
result = 1
return result

def receivebyte(tim eout):
global freeser
sectimeout = int((timeout+5)/10)
time.sleep(sect imeout)
string = freeser.read(1)
if string == '':
result = -1
else:
result = ord(string)
return result

def readbyte():
global freeser
string = freeser.read(1)
if string == '':
result = -1
else:
result = ord(string)
return result

def SetSpeed(speed) :
global freeser
if speed == '9600':
freeser.setBaud rate(9600)
result = 1
elif speed == '19200':
freeser.setBaud rate(19200)
result = 1
elif speed == '115200':
freeser.setBaud rate(115200)
result = 1
else:
result = -1
return result

This is the serial class

class Serial(serialut il.FileLike):
def __init__(self,
port, #number of device, numbering
starts at
#zero. if everything fails, the
user
#can specify a device string,
note
#that this isn't portable
anymore
baudrate=9600, #baudrate
bytesize=EIGHTB ITS, #number of databits
parity=PARITY_N ONE, #enable parity checking
stopbits=STOPBI TS_ONE, #number of stopbits
timeout=None, #set a timeout value, None to
wait forever
xonxoff=0, #enable software flow control
rtscts=0, #enable RTS/CTS flow control
):
"""initiali ze comm port"""

self.timeout = timeout

if type(port) == type(''): #strings are taken directly
self.portstr = port
else:
self.portstr = device(port)

try:
self.hComPort = win32file.Creat eFile(self.port str,
win32con.GENERI C_READ | win32con.GENERI C_WRITE,
0, # exclusive access
None, # no security
win32con.OPEN_E XISTING,
win32con.FILE_A TTRIBUTE_NORMAL |
win32con.FILE_F LAG_OVERLAPPED,
None)
except Exception, msg:
self.hComPort = None #'cause __del__ is called anyway
raise serialutil.Seri alException, "could not open port: %s"
% msg
# Setup a 4k buffer
win32file.Setup Comm(self.hComP ort, 4096, 4096)

#Save original timeout values:
self.orgTimeout s = win32file.GetCo mmTimeouts(self .hComPort)

#Set Windows timeout values
#timeouts is a tuple with the following items:
#(ReadIntervalT imeout,ReadTota lTimeoutMultipl ier,
# ReadTotalTimeou tConstant,Write TotalTimeoutMul tiplier,
# WriteTotalTimeo utConstant)
if timeout is None:
timeouts = (0, 0, 0, 0, 0)
elif timeout == 0:
timeouts = (win32con.MAXDW ORD, 0, 0, 0, 0)
else:
#timeouts = (0, 0, 0, 0, 0) #timeouts are done with
WaitForSingleOb ject
timeouts = (0, 0, int(timeout*100 0), 0, 0)
win32file.SetCo mmTimeouts(self .hComPort, timeouts)

#win32file.SetC ommMask(self.hC omPort, win32file.EV_RX CHAR |
win32file.EV_TX EMPTY |
# win32file.EV_RX FLAG | win32file.EV_ER R)
#~ win32file.SetCo mmMask(self.hCo mPort,
#~ win32file.EV_RX CHAR | win32file.EV_RX FLAG |
win32file.EV_ER R)
win32file.SetCo mmMask(self.hCo mPort, win32file.EV_ER R)

# Setup the connection info.
# Get state and modify it:
comDCB = win32file.GetCo mmState(self.hC omPort)
comDCB.BaudRate = baudrate

if bytesize == FIVEBITS:
comDCB.ByteSize = 5
elif bytesize == SIXBITS:
comDCB.ByteSize = 6
elif bytesize == SEVENBITS:
comDCB.ByteSize = 7
elif bytesize == EIGHTBITS:
comDCB.ByteSize = 8

if parity == PARITY_NONE:
comDCB.Parity = win32file.NOPAR ITY
comDCB.fParity = 0 # Dis/Enable Parity Check
elif parity == PARITY_EVEN:
comDCB.Parity = win32file.EVENP ARITY
comDCB.fParity = 1 # Dis/Enable Parity Check
elif parity == PARITY_ODD:
comDCB.Parity = win32file.ODDPA RITY
comDCB.fParity = 1 # Dis/Enable Parity Check

if stopbits == STOPBITS_ONE:
comDCB.StopBits = win32file.ONEST OPBIT
elif stopbits == STOPBITS_TWO:
comDCB.StopBits = win32file.TWOST OPBITS
comDCB.fBinary = 1 # Enable Binary Transmission
# Char. w/ Parity-Err are replaced with 0xff (if fErrorChar is
set to TRUE)
if rtscts:
comDCB.fRtsCont rol = win32file.RTS_C ONTROL_HANDSHAK E
comDCB.fDtrCont rol = win32file.DTR_C ONTROL_HANDSHAK E
else:
comDCB.fRtsCont rol = win32file.RTS_C ONTROL_ENABLE
comDCB.fDtrCont rol = win32file.DTR_C ONTROL_ENABLE
comDCB.fOutxCts Flow = rtscts
comDCB.fOutxDsr Flow = rtscts
comDCB.fOutX = xonxoff
comDCB.fInX = xonxoff
comDCB.fNull = 0
comDCB.fErrorCh ar = 0
comDCB.fAbortOn Error = 0

win32file.SetCo mmState(self.hC omPort, comDCB)

# Clear buffers:
# Remove anything that was there
win32file.Purge Comm(self.hComP ort,
win32file.PURGE _TXCLEAR |
win32file.PURGE _TXABORT |
win32file.PURGE _RXCLEAR |
win32file.PURGE _RXABORT)

#print win32file.Clear CommError(self. hComPort) #flags, comState
=

self._overlappe dRead = win32file.OVERL APPED()
self._overlappe dRead.hEvent = win32event.Crea teEvent(None, 1,
0, None)
self._overlappe dWrite = win32file.OVERL APPED()
self._overlappe dWrite.hEvent = win32event.Crea teEvent(None, 0,
0, None)

def __del__(self):
self.close()

def close(self):
"""close port"""
if self.hComPort:
#Restore original timeout values:
win32file.SetCo mmTimeouts(self .hComPort, self.orgTimeout s)
#Close COM-Port:
win32file.Close Handle(self.hCo mPort)
self.hComPort = None

def setBaudrate(sel f, baudrate):
"""change baudrate after port is open"""
if not self.hComPort: raise portNotOpenErro r
# Setup the connection info.
# Get state and modify it:
comDCB = win32file.GetCo mmState(self.hC omPort)
comDCB.BaudRate = baudrate
win32file.SetCo mmState(self.hC omPort, comDCB)

def inWaiting(self) :
"""returns the number of bytes waiting to be read"""
flags, comstat = win32file.Clear CommError(self. hComPort)
return comstat.cbInQue

def read(self, size=1):
"""read num bytes from serial port"""
if not self.hComPort: raise portNotOpenErro r
if size > 0:
win32event.Rese tEvent(self._ov erlappedRead.hE vent)
flags, comstat = win32file.Clear CommError(self. hComPort)
if self.timeout == 0:
n = min(comstat.cbI nQue, size)
if n > 0:
rc, buf = win32file.ReadF ile(self.hComPo rt,
win32file.Alloc ateReadBuffer(n ), self._overlappe dRead)

win32event.Wait ForSingleObject (self._overlapp edRead.hEvent,
win32event.INFI NITE)
read = str(buf)
else:
read = ''
else:
rc, buf = win32file.ReadF ile(self.hComPo rt,
win32file.Alloc ateReadBuffer(s ize), self._overlappe dRead)
n = win32file.GetOv erlappedResult( self.hComPort,
self._overlappe dRead, 1)
read = str(buf[:n])
else:
read = ''
return read

def write(self, s):
"""write string to serial port"""
if not self.hComPort: raise portNotOpenErro r
#print repr(s),
if s:
err, n = win32file.Write File(self.hComP ort, s,
self._overlappe dWrite)
if err: #will be ERROR_IO_PENDIN G:
# Wait for the write to complete.

win32event.Wait ForSingleObject (self._overlapp edWrite.hEvent,
win32event.INFI NITE)

def flushInput(self ):
if not self.hComPort: raise portNotOpenErro r
win32file.Purge Comm(self.hComP ort, win32file.PURGE _RXCLEAR |
win32file.PURGE _RXABORT)

def flushOutput(sel f):
if not self.hComPort: raise portNotOpenErro r
win32file.Purge Comm(self.hComP ort, win32file.PURGE _TXCLEAR |
win32file.PURGE _TXABORT)

def sendBreak(self) :
if not self.hComPort: raise portNotOpenErro r
import time
win32file.SetCo mmBreak(self.hC omPort)
#TODO: how to set the correct duration??
time.sleep(0.02 0)
win32file.Clear CommBreak(self. hComPort)

def setRTS(self,lev el=1):
"""set terminal status line"""
if not self.hComPort: raise portNotOpenErro r
if level:
win32file.Escap eCommFunction(s elf.hComPort,
win32file.SETRT S)
else:
win32file.Escap eCommFunction(s elf.hComPort,
win32file.CLRRT S)

def setDTR(self,lev el=1):
"""set terminal status line"""
if not self.hComPort: raise portNotOpenErro r
if level:
win32file.Escap eCommFunction(s elf.hComPort,
win32file.SETDT R)
else:
win32file.Escap eCommFunction(s elf.hComPort,
win32file.CLRDT R)

def getCTS(self):
"""read terminal status line"""
if not self.hComPort: raise portNotOpenErro r
return MS_CTS_ON & win32file.GetCo mmModemStatus(s elf.hComPort)
!= 0

def getDSR(self):
"""read terminal status line"""
if not self.hComPort: raise portNotOpenErro r
return MS_DSR_ON & win32file.GetCo mmModemStatus(s elf.hComPort)
!= 0

def getRI(self):
"""read terminal status line"""
if not self.hComPort: raise portNotOpenErro r
return MS_RING_ON & win32file.GetCo mmModemStatus(s elf.hComPort)
!= 0

def getCD(self):
"""read terminal status line"""
if not self.hComPort: raise portNotOpenErro r
return MS_RLSD_ON & win32file.GetCo mmModemStatus(s elf.hComPort)
!= 0

#Nur Testfunktion!!
if __name__ == '__main__':
print __name__
s = Serial(0)

About second question I have to read a string of data from the modem
serial port but I was using .readbyte to semplify the code. In effect
..readbyte doesn't return a string type. I repeat the test with .read
method but I discovered another strange behaviour. If the string is not
'sended' to a DTE (serial not connected ot other) the .read method read
the string(s) still not 'sent'. In other words it seems that the rx and
tx serial buffer are shared.

Thanks for your time.
Dario.

Sep 9 '05 #5
Has anyone here upgraded from 2.3 to 2.4 on Tiger?
If so how'd ya do it?

TIA,
Kevin
Sep 9 '05 #6
On 9 Sep 2005 07:17:10 -0700, "dario" <ke******@liber o.it> declaimed the
following in comp.lang.pytho n:
Dennis, my english is not too good...

About first question this is the implementation of SER class (this is
freeware from the source www.telit.it):
import time
import serial

freeser = serial.Serial(' COM4', 9600, timeout=0, rtscts=1)
Not the cleanest implementation -- as long as they are wrapping
serial, they should have used a class of their own <G>

Okay... According to the small documents for pyserial, "timeout=0"
means return immediately, never wait...

Now for the routine in question...
def readbyte():
global freeser
string = freeser.read(1)
if string == '':
result = -1
else:
result = ord(string)
return result
According to this, readbyte() is NOT returning characters! It is
returning an integer: 0..255 if a data byte is received, and -1 if the
port was empty. So...

import time
import SER
..
..
..
clist = []
SER.send(' sono nel while stringZVEI==st vuota')
# note, the following loop is going to give 10 seconds
# for EACH character before it breaks out
while True:
time.sleep(10) #assuming MOD.sleep() also uses seconds
byte = SER.readbyte()
if byte == -1: break # -1 indicates no data
clist.append(ch r(byte)) #save CHARACTER in list
# note, I'm not testing to see if any data came in at all
# if you need to repeat the prompt and read sequence
# you need another loop
SER.send(' stringZVEI=')
cstr = "".join(cli st)
SER.send(cstr)

-=-=-=-=-=-=-=-

However, it looks like the above could just as easily be done with

import serial
..
..
..
ser = serial.Serial(' COM4', 9600, timeout=0, rtscts=1)
while True:
ser.write(' sono nel while stringZVEI==st vuota')
time.sleep(10) #give the use 10 seconds to type all
if ser.inwaiting() > 0:
cstr = ser.read(ser.in waiting()) #just in case a few
#more were typed
ser.write(' stringZVEI=')
ser.write(cstr)
break #exit the loop
#note, this version will repeat the prompt and read if
#nothing was entered


About second question I have to read a string of data from the modem
serial port but I was using .readbyte to semplify the code. In effect
.readbyte doesn't return a string type. I repeat the test with .read
method but I discovered another strange behaviour. If the string is not
'sended' to a DTE (serial not connected ot other) the .read method read
the string(s) still not 'sent'. In other words it seems that the rx and
tx serial buffer are shared.
I don't see that behavior in the code -- might be something in how
the actual device is working. You may need to put in a delay slightly
longer than the expected time needed to send "x" characters.
-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Sep 9 '05 #7
stri ker wrote:
Has anyone here upgraded from 2.3 to 2.4 on Tiger?
If so how'd ya do it?


You just run the official installer.

http://python.org/ftp/python/2.4.1/M...SX-2.4.1-1.dmg

Note that this does *not* replace 2.3 which was installed by Apple.
That's a good thing. Instead, the executables get installed to
/usr/local/bin . If you want

$ python

to give you 2.4.1, then make sure that /usr/local/bin comes before
/usr/bin in your $PATH.

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Sep 9 '05 #8
stri ker <st*****@trip.n et> writes:
Has anyone here upgraded from 2.3 to 2.4 on Tiger?
If so how'd ya do it?


You don't. You install 2.4 in parallel with 2.3. You can do pretty
much whatever you want with /usr/bin/python, /usr/local/bin/python,
etc. - Tiger doesn't seem to use those. I don't remember if I replaced
one or not, but don't touch anything else about the 2.3 installtion.

I installed the darwinports version of 2.4, and have been using it
ever since for all my stuff.

<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Sep 9 '05 #9
[Mike Meyer wrote]
stri ker <st*****@trip.n et> writes:
Has anyone here upgraded from 2.3 to 2.4 on Tiger?
If so how'd ya do it?


You don't. You install 2.4 in parallel with 2.3. You can do pretty
much whatever you want with /usr/bin/python, /usr/local/bin/python,
etc. - Tiger doesn't seem to use those. I don't remember if I replaced
one or not, but don't touch anything else about the 2.3 installtion.

I installed the darwinports version of 2.4, and have been using it
ever since for all my stuff.


There are also the following install options:

- ActivePython:
http://www.activestate.com/Products/ActivePython/
(disclaimer: I make this distro)

- MacPython:
http://undefined.org/python/#python
by Bob Ippolito

- fink (similar in spirit to the darwinports project) also has a Python
I believe
Trent

--
Trent Mick
Tr****@ActiveSt ate.com
Sep 9 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3223
by: martin | last post by:
Hello, I just got the SUN Java IDE. (Netbeans IDE 3.5.1) Very very nice, and I worked myself through the tutorial (about making a colorswitch). Now, When I compile it gives no errors at all. So far so good. But when I want to execute, it askes to "set project main class". The only option it displays is the default project. But the "okay" button won't highlight. I cannot select anything else, nor can I roam directories to select
11
2568
by: Svens | last post by:
Hey everyone! I'm a math student working on a short script involving logs. I have a function on my scientific calculator, and was wondering if there was a similar funtion in python. For example: (log65536)/(log4)= 8 I've searched around a bit and haven't been able to find anything.
4
1451
by: IS | last post by:
At the recommendation of several people in this newsgroup I have downloaded two or three Compilers. One is the Beta version of Microsoft's Visual C++ 2005. I have entered a complete beginner code that looks like this: #include <iostream> using namespace std: //introduces namespace std int main( void )
3
6473
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I COULD be wrong... :) I've tried the access group...twice...and all I get is "Access doesn't like ".", which I know, or that my query names are too long, as there's a limit to the length of the SQL statement(s). But this works when I don't try to...
12
4642
by: uno | last post by:
Hello, I am a beginner with the programming and I have some question. I am reading manuals from Internet and some book from the library. In all those documents the C language operate wint plain text files, and I want to know how operate with formated files (msexcel, msaccess, mysql, etc..). If it isn't possible with C, with C++ is possible? Thanks a beginner (P.D.- Sorry for my poor english)
1
2627
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am experimenting a bit with what I need to do this and have the following code snippet. But first if I pass the assembly name and type to Activator.CreateInstance() it always fails. However if I walk my assembly and get a type value, the call to...
10
4473
by: Roman Zeilinger | last post by:
Hi I have a beginner question concerning fscanf. First I had a text file which just contained some hex numbers: 0C100012 0C100012 ....
4
1561
by: a | last post by:
Dear all vb.net developer I want to know the time I need to master vb.net? I'm beginner
3
2047
by: Ben Keshet | last post by:
I have a probably simple beginner's question - I have a script that I am currently able to print its output. instead, i want to write it into a file - I tried different versions of write() but might have gotten the syntax wrong. the variable I want to write is a line from a file I am reading: "... f = open('receptor.mol2', 'r') line = f.readline()
2
1852
by: roanhn | last post by:
Hello. I've to to write a master's thesis. Currently I deal with php, mysql, ajax. Fate decreed that I've to choose one of this subjects: 1.gdi+ library in .net technology 2.ado.net technology in VS 2008. I didn't have contact with Visual Studio, .NET. I only know some basics of c++. My question is what subject of your point of view will be easier for absolute beginner in .net domain. From writing which subject I gain more knowledge...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10484
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.