x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to create a string comparison with FString for conditional breakpoints in VS2013?

Heyo, I'm trying to create a conditional breakpoint inside a function that has an FString as an argument. I want to break when that FString is a string but can't seem to find a proper way to compare because it cannot be compared with hardcoded strings, and the conditional breakpoint window is not a robust playing field for creating it.

anyone has tips?

Product Version: Not Selected
Tags:
more ▼

asked Apr 20 '15 at 06:30 PM in C++ Programming

avatar image

danr
18 4 6 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello, danr

Please note, that in this situation you can use the check(expr) macro. For comparison of FStrings, you can use Equals() and Contains() functions. For example, in the following method TestValue parameter is checked and in case it doesn’t contain “test” word, breakpoint is triggered:

 void AMyCharacter::TestString(const FString& testValue) {
     check(testValue.Contains(TEXT("test")));
 }

If you like to learn more about FString class, please go here:

https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/StringHandling/FString/index.html

Also, if you like to learn more about String handling in Unreal Engine 4 , please go here:

https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/StringHandling/index.html

Hope this helped! Have a great day!

more ▼

answered May 03 '15 at 09:42 AM

avatar image

Andrii Melnyk
1.9k 60 20 112

avatar image danr May 03 '15 at 07:27 PM

Great! thanks

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question