Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

some general questions from a vb guy!!!

Posted on 1998-11-25
2
Medium Priority
?
219 Views
Last Modified: 2010-04-01
Two questions.

1. Visual Basic has a feature called On Error Resume Next and On Error GoTo TrapError, which allows you to trap error and/or avoid them. Is there a similar way of doing this is C++? Everytime I run into an error, I have to reboot my computer.

2. VB also has a feature which allows you to exit a function from within a function. It's something like "Exit Sub". How do I do this in C++. Do I use Break?

Thanks.
0
Comment
Question by:hobster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 0 total points
ID: 1178643
1. For something like 'On Error goto' use C++ TRY/CATCH statements

2. No, 'break' can only be used in loops and 'sitch' statements, simply use 'return( <returntype>)
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1178644
1. try, catch, and throw for errors.
2. equivalent of EXIT SUB is the return statement.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question